You are not logged in.

#1 2013-05-13 18:15:33

dsulli99
Member
Registered: 2010-11-18
Posts: 31

Render specific character

Hi,

I have kind of a dumb question regarding getting characters to render on a screen.  Basically, I use Xmonad, xterm, and xmobar.   I also use a specific font called profont.  If I type:

xfd -fa -nil-profont-medium-r-normal--12-120-72-72-c-60-iso8859-1

I can see every single character that is available for the font.  My question is this:

Is it possible to either:

1) Render an atribtrary character by using a keyboard code (like the alt+ascii in Windows)
or
2) Copy and paste the character from an app (such as xfd)?

I read somewherre that Ctrl-Shift-U + alphanumeric code might work for unicode characters, however I am not getting results with this in Xmonad.

The reason why I am trying to do this is because I would like to use some some special characters to enhance my UI a bit (purely cosmetic).  Thank-you so much for taking the time to answer my question.

Dan

Offline

#2 2013-05-13 23:54:17

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: Render specific character

You can copy and paste into xterm, as long as the font supports that character and your locale settings support utf-8.  I have this set in my xterm resources:

XTerm*locale: true
xterm*faceName: DejaVu Sans Mono:style=Book:antialias=false
xterm*faceNameDoublesize: WenQuanYi Bitmap Song

And

$ locale -a
C
POSIX
en_US
en_US.iso88591
en_US.utf8

From an xterm:
screen02.png]
Any glyph in those two xterm fonts can be displayed.  I copied the unusual for US English characters above from gucharmap.  As for typing them in, see this: http://superuser.com/questions/193344/h … s-in-xterm.

Vim, in xterm, will support utf-8 characters.  From Insert mode, press 'Ctrl-v', then 'u', then the 4-digit code.

Offline

#3 2013-05-14 23:44:22

dsulli99
Member
Registered: 2010-11-18
Posts: 31

Re: Render specific character

Hi,

Thank-you very much for your reply.  I think what you did actually works.  I guess part of my problem now is that I want to render the character programatically.  I am actually able to do this from the shell by using the following command:

echo -e "\x00\x00\xb7"

I'm basically trying to use the middle dot as a fancy field separator on the output of xmobar.  Although thanks to your help I am able to actually copy and paste the character to the buffer, and render it to the screen (using the command above or simply by pasting it).  My problem now is that I cannot use it in a template of xmobar.  My config looks like this:

Config {
       --font = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*"
       --This appears to work with any from xfontsel 12/28/2012
       --font = "-nil-profont-medium-r-normal--12-120-72-72-c-60-iso8859-1"
       font = "-*-profont-*-*-*-*-15-*-*-*-*-*-*-*"
       --Place the bar at the bottom, centered with 75% of the screen width
       --, position = BottomW C 75
       , position = Top
       , bgColor = "black"
       , fgColor = "grey"
       , border = BottomB
       , borderColor = "#af00ff"
       --Send the window to the bottom of the window stack initially
       , lowerOnStart = True
       , commands = [
            Run Network "eth0" ["-L","0","-H","32","--normal","grey","--high","grey"] 10
            , Run Cpu ["-L","3","-H","50","--normal","grey","--high","grey"] 10
            , Run Memory ["-t","Mem: <usedratio>%"] 10
            , Run StdinReader
            , Run Com "echo" ["dps"] "echoInitials" 0 --0 means run only once
            , Run Com "date" [] "customClock" 10 --do it once per second (last parameter is tenths of second).
            , Run Com "echo" ["-e", "\"\\x00\\x00\\xb7\""] "fancyDot" 0
       ]
       --The character to be used for indicating commands in the output template.
       , sepChar = "%"
       --The text before the first character will be left aligned, the text between them
       --will be centered, and the text to the right of the last character will be right aligned.
       , alignSep = "}{"
       , template = "%echoInitials% <fc=#8ae234>%fancyDot%</fc> %eth0% %memory% %cpu% %customClock% }{ %StdinReader%"
}

This is kind of a specific question.  I'm going to take this up with the developers of xmobar.  Thank-you so much for your help, I'll try to remember to report back if I come up with any useful solution.

Dan

Offline

Board footer

Powered by FluxBB