Lazy Fox wrote:
> There were 16 default fonts in the FLTK, and the "sans" is the first font of
> them.
> Where can I find them in the filesystem?
> I think there must be a "sans.ttf" in "/usr/share/fonts/", or somewhere.
Hmm, yes: under linux with xft, FL_HELVETICA equates to " sans",
which is part of the "X FreeType" (XFT) interface (see 'man xft').
(You can see this association in the src/fl_font_xft.cxx file)
I admittedly don't know much about this myself, but googling around
for 'xft xfontsel equivalent', I found:
http://lists.freedesktop.org/archives/fontconfig/2006-August/002361.html
..which seems to show some tools like 'xfd' and fc-match' that will
point you in the right direction. To view the font was easy enough:
% xfd -fa " sans"
..which brings a really retro-1980's ancient Athena-looking font viewer
GUI showing the correct ttf name for the font, and an "ABCDEF.." chart
of the font's antialiased glyphs.
Wow, first time I've ever seen an athena app show antialiased text ;)
And to just get the font's full file system name:
% fc-match -v "sans" | awk '/file:/ {print $NF}' | awk -F\" '{print $2}'
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf
..or to just get the filename without the path is just:
% fc-match " sans"
DejaVuSans.ttf: "DejaVu Sans" "Book"
I forget what the leading space is for.. one of the FLTK core folks
can probably remind us.
I found I didn't need 'ftview', which wasn't present on my
Ubuntu system by default, but I found I could install it easily
enough with:
apt-get install freetype2-demos
..which I found I could use by running:
% ftview 18 /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf
..which loaded up another athena font viewer, similar to xfd.
But I'm not sure it was worth the trouble to install freetype2-demos
just for that; xfd seems fine.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk