Using wxGTK-2.6.2 on Scientific Linux Release 4.0
Is it possible to draw symbols, e.g. greek letter theta, integral sign, etc.
using the wxDC::DrawText method, and if so, how???
Trying out the font sample included with the distribution, I can choose the
font "Standard Symbols L" from the font dialog, but it only shows the
usual A-Z a-z alphabet, while xfontsel displays the greek characters as
expected.
Any help is appreciated.
Joe Chuma
how to draw text symbols
-
- Earned some good credits
- Posts: 120
- Joined: Sun Aug 29, 2004 3:09 pm
- Location: Grenoble, France
- Contact:
Yes you can, but - as all text software - you must change the font you use.
If you select a symbol font (1& 2) and use it with wxDC::DrawText, the text is writted with symbols.
1 : http://www.wxwidgets.org/manuals/2.6.2/ ... tml#wxfont
2 : http://www.wxwidgets.org/manuals/2.6.2/ ... xdcsetfont
If you select a symbol font (1& 2) and use it with wxDC::DrawText, the text is writted with symbols.
1 : http://www.wxwidgets.org/manuals/2.6.2/ ... tml#wxfont
2 : http://www.wxwidgets.org/manuals/2.6.2/ ... xdcsetfont
What is little and green, witch go up and down ??
Yoda playing with the force.
Yoda playing with the force.
-
- Can't get richer than this
- Posts: 802
- Joined: Mon Dec 27, 2004 10:46 am
- Location: Estonia, Tallinn
- Contact:
Actually, wxGTK of course uses GTK+, which in turn uses pango to do its font stuff.
Now, pango uses font-config in a way that you are always almost guaranteed to be shown a glyph, if it exists in any installed font that font-config can see. Simply the selected font is the first where it is looked from.
To show greek letters, you need
a) Use an unicode build of wxWidgets
b) Pass the appropriate unicode value for the letter to DrawText, or another method you are using.
Now, pango uses font-config in a way that you are always almost guaranteed to be shown a glyph, if it exists in any installed font that font-config can see. Simply the selected font is the first where it is looked from.
To show greek letters, you need
a) Use an unicode build of wxWidgets
b) Pass the appropriate unicode value for the letter to DrawText, or another method you are using.
Compilers: gcc-3.3.6, gcc-3.4.5, gcc-4.0.2, gcc-4.1.0 and MSVC6
OS's: Gentoo Linux, WinXP; WX: CVS HEAD
Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/
OS's: Gentoo Linux, WinXP; WX: CVS HEAD
Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/
-
- Can't get richer than this
- Posts: 802
- Joined: Mon Dec 27, 2004 10:46 am
- Location: Estonia, Tallinn
- Contact:
Yeah, to be cross-platform, what you tell, will be important too.
Compilers: gcc-3.3.6, gcc-3.4.5, gcc-4.0.2, gcc-4.1.0 and MSVC6
OS's: Gentoo Linux, WinXP; WX: CVS HEAD
Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/
OS's: Gentoo Linux, WinXP; WX: CVS HEAD
Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/