Using Raster fonts
-
- Knows some wx things
- Posts: 33
- Joined: Fri Jun 30, 2017 12:34 pm
Using Raster fonts
I would like to use raster fonts but not sure wxWidgets will work with .fon files. Also would like to know if I can find source for raster fonts?
Re: Using Raster fonts
wxWidgets can work with both bitmap and vector fonts that are installed on the system.
Since wx 3.1.1 there is a new static method to use external fonts:
https://docs.wxwidgets.org/trunk/classw ... 4c7d1ec620
This only works for truetype fonts though.
Since wx 3.1.1 there is a new static method to use external fonts:
https://docs.wxwidgets.org/trunk/classw ... 4c7d1ec620
This only works for truetype fonts though.
Use the source, Luke!
-
- Knows some wx things
- Posts: 33
- Joined: Fri Jun 30, 2017 12:34 pm
Re: Using Raster fonts
I noticed my fonts are installed under \windows and not \windows\fonts. Is that a problem. This is a windows embedded compact 7 system.
Also if I install raster fonts on my system should I be able to just specify the font name to use those fonts?
Also if I install raster fonts on my system should I be able to just specify the font name to use those fonts?
Re: Using Raster fonts
Run the "fonts" sample that comes with wxWidgets.
Actually, i'm not sure any more that wxWidgets can use any font. In the sample i see fewer fonts than i see in the Windows control panel.
Actually, i'm not sure any more that wxWidgets can use any font. In the sample i see fewer fonts than i see in the Windows control panel.
Use the source, Luke!
Re: Using Raster fonts
I do not know about Windows Embedded, but on Windows 10 the font sample seems to work with "Terminal", which I believe is a raster font - it is a font available under Raster Fonts in the dialog where you set the font for the command prompt window.
On MSW, wxFont::AddPrivateFont() uses ::AddFontResourceEx() which is documented to support also raster fonts. But whether the wxFont can be, contrary to its docs, created from a private raster font... It should be easy to test though.
Edit:
FWIW, I donwloaded Leros and Yamaha fonts from https://www.cylog.org/graphics/rasterfonts.jsp and tried to load them as private fonts by modifying the font sample. Seemed to work.
MSW 10 Pro, wxWidgets recentish master
On MSW, wxFont::AddPrivateFont() uses ::AddFontResourceEx() which is documented to support also raster fonts. But whether the wxFont can be, contrary to its docs, created from a private raster font... It should be easy to test though.
Edit:
FWIW, I donwloaded Leros and Yamaha fonts from https://www.cylog.org/graphics/rasterfonts.jsp and tried to load them as private fonts by modifying the font sample. Seemed to work.
MSW 10 Pro, wxWidgets recentish master