How to change the font in rviz markers, and make it support unicode?

TODO insert github issue

Have rviz cloned in tmp_catkin_ws, can source devel/setup.bash, but it seems like some portions of the system installed rviz are still being used?

Changing the fontName in ogre_helpers/movable_text.h header did not change the font. Just hardcode into movable_text.cpp constructor setFontName().

The default Arial font was really /usr/share/fonts/truetype/msttcorefonts/Arial.ttf?

Other fonts in that directory:

Andale_Mono.ttf              Courier_New_Italic.ttf           Times_New_Roman.ttf
andalemo.ttf                 Courier_New.ttf                  times.ttf
arialbd.ttf                  couri.ttf                        trebucbd.ttf
arialbi.ttf                  cour.ttf                         trebucbi.ttf
Arial_Black.ttf              Georgia_Bold_Italic.ttf          Trebuchet_MS_Bold_Italic.ttf
Arial_Bold_Italic.ttf        Georgia_Bold.ttf                 Trebuchet_MS_Bold.ttf
Arial_Bold.ttf               georgiab.ttf                     Trebuchet_MS_Italic.ttf
Arial_Italic.ttf             Georgia_Italic.ttf               Trebuchet_MS.ttf
ariali.ttf                   georgiai.ttf                     trebucit.ttf
arial.ttf                    georgia.ttf                      trebuc.ttf
Arial.ttf                    Georgia.ttf                      Verdana_Bold_Italic.ttf
ariblk.ttf                   georgiaz.ttf                     Verdana_Bold.ttf
comicbd.ttf                  impact.ttf                       verdanab.ttf
Comic_Sans_MS_Bold.ttf       Impact.ttf                       Verdana_Italic.ttf
Comic_Sans_MS.ttf            timesbd.ttf                      verdanai.ttf
comic.ttf                    timesbi.ttf                      verdana.ttf
courbd.ttf                   timesi.ttf                       Verdana.ttf
courbi.ttf                   Times_New_Roman_Bold_Italic.ttf  verdanaz.ttf
Courier_New_Bold_Italic.ttf  Times_New_Roman_Bold.ttf         webdings.ttf
Courier_New_Bold.ttf         Times_New_Roman_Italic.ttf       Webdings.ttf

Try Courier_New- no that results in exception.

The font is actually in /opt/ros/jade/share/rviz/ogre_media/fonts/, which contains arial.fontdef arial.ttf font_arial.png. I can see some unicode characters in font_arial.png

TODO show font_arial.png

But are they at the right index?

There are 18 characters per row, and the degree symbol is on the 8th row, 16th column- no thee number of columns varies, cannot find the index like that.

Want to use the degree symbol which is u00b0, on linux gnome terminal and vim press ctrl+shif+u, then type 00b0: °. 0xb0 = 176

Try altering the png and running rviz. Altering it in the tmp_catkin_ws ogre_media dir did not work. Next try the opt location- no change.

Maybe can alter the ttf file and see if that causes a change, or copy in a different ttf- probably needs a fontdef with it? Only other fontdef is in Gazebo fonts /usr/share/gazebo-5.0/media/fonts .

Written on April 21, 2016