From 2988193e44c183542a8f7cf52dc63f76ec3c5249 Mon Sep 17 00:00:00 2001 From: Ole Loots Date: Sat, 25 Aug 2012 05:44:44 +0200 Subject: Documented font loading / font names. --- atari/plot/font_freetype.c | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) (limited to 'atari') diff --git a/atari/plot/font_freetype.c b/atari/plot/font_freetype.c index 8eb15e280..ad21d0f69 100755 --- a/atari/plot/font_freetype.c +++ b/atari/plot/font_freetype.c @@ -18,6 +18,7 @@ */ #ifdef WITH_FREETYPE_FONT_DRIVER + #include #include FT_CACHE_H @@ -25,12 +26,52 @@ #include "atari/plot/plot.h" #include "atari/plot/font_freetype.h" #include "atari/findfile.h" - + +/* -------------------------------------------------------------------------- */ +/* Font Loading & Mapping scheme */ +/* -------------------------------------------------------------------------- */ +/* + +Truetype fonts are loaded in the following priority order: + +1. Option values. +2. default resouce names (8.3 compatible). +3. default font package installation path. + + +Resource font names & their meanings: +-------------------------------------------- +s.ttf => Serif +sb.ttf => Serif Bold +ss.ttf => Sans Serif *Default Font +ssb.ttf => Sans Serif Bold +ssi.ttf => Sans Serif Italic +ssib.ttf => Sans Serif Italic Bold +mono.ttf => Monospaced +monob.ttf => Monospaced Bold +cursive.ttf => Cursive +fantasy.ttf => Fantasy +*/ + + /* Cursive */ + font_faces[FONT_FACE_CURSIVE] = + ft_new_face(nsoption_charp(atari_face_cursive), + "fonts/cursive.ttf", + DEJAVU_PATH"DejaVuSansMono-Oblique.ttf"); + + /* Fantasy */ + font_faces[FONT_FACE_FANTASY] = + ft_new_face(nsoption_charp(atari_face_fantasy), + "fonts/fantasy.ttf", + + + #define DEJAVU_PATH "/usr/share/fonts/truetype/ttf-dejavu/" + #define CACHE_SIZE 2048 #define CACHE_MIN_SIZE (100 * 1024) #define BOLD_WEIGHT 700 - + extern css_fixed nscss_screen_dpi; extern unsigned long atari_plot_flags; -- cgit v1.2.3