mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 04:26:50 +03:00
Clean up framebuffer compile time font selection
Make framebuffer font documentation match reality Expose glyph cache size as a configuration option svn path=/trunk/netsurf/; revision=10871
This commit is contained in:
parent
409b3ef879
commit
84a0a62988
@ -79,26 +79,46 @@
|
||||
The font glyphs are, by default, rendered as 256 level transparency
|
||||
which gives excellent visual results even on small font sizes.
|
||||
|
||||
The default font is the Vera trutype font set. The default path they
|
||||
are sourced from is /usr/share/fonts/truetype/ttf-bitstream-vera/ .
|
||||
The default font is the DejaVu trutype font set. The default path they
|
||||
are sourced from is /usr/share/fonts/truetype/ttf-dejavu/ .
|
||||
|
||||
The compiled in default paths may be altered by setting values in
|
||||
the user configuration makefile Makefile.config. These values must
|
||||
be set to teh absolute path of the relevant font file including its
|
||||
.ttf extension. The variables are:
|
||||
|
||||
NETSURF_FB_FONT_SANS_SERIF
|
||||
NETSURF_FB_FONT_SANS_SERIF_BOLD
|
||||
NETSURF_FB_FONT_SANS_SERIF_ITALIC
|
||||
NETSURF_FB_FONT_SANS_SERIF_ITALIC_BOLD
|
||||
NETSURF_FB_FONT_SERIF
|
||||
NETSURF_FB_FONT_SERIF_BOLD
|
||||
NETSURF_FB_FONT_MONOSPACE
|
||||
NETSURF_FB_FONT_MONOSPACE_BOLD
|
||||
NETSURF_FB_FONT_CURSIVE
|
||||
NETSURF_FB_FONT_FANTASY
|
||||
|
||||
The font selection may be changed by placing truetype font files
|
||||
in the resources path. The resource files will be the generic names
|
||||
sans_serif.ttf, sans_serif_bold.ttf etc. The selection may also be
|
||||
overridden by setting options.
|
||||
sans_serif.ttf, sans_serif_bold.ttf etc.
|
||||
|
||||
The font system is configured at runtime by several options. The
|
||||
fb_font_monochrome option causes the renderer to use monochrome
|
||||
glyph rendering which is faster to plot but slower to render and
|
||||
much less visually appealing. The remaining seven options control
|
||||
the files to be used for font faces.
|
||||
much less visually appealing.
|
||||
|
||||
The remaining seven options control the files to be used for font faces.
|
||||
|
||||
fb_face_sans_serif - The sans serif face
|
||||
fb_face_sans_serif_bold - The bold sans serif face
|
||||
fb_face_sans_serif_italic - The italic sans serif face
|
||||
fb_face_sans_serif_italic_bold - The bold italic sans serif face.
|
||||
fb_face_monospace - The monospaced font
|
||||
fb_face_serif - The serif font
|
||||
fb_serif_bold - The bold serif font
|
||||
fb_face_monospace - The monospaced font
|
||||
fb_face_monospace_bold - The bold monospaced font
|
||||
fb_face_cursive - The cursive font
|
||||
fb_face_fantasy - The fantasy font
|
||||
|
||||
Old Freetype
|
||||
--------------
|
||||
|
@ -155,27 +155,47 @@ Configuring
|
||||
then several configuration options are available. If the simple
|
||||
bitmap glyphs are used none of these options apply.
|
||||
|
||||
Font faces are provided for the css default styles of sans serif,
|
||||
serif, monospace, cursive and fantasy. Only the sans serif
|
||||
non-italic normal weight font is required to exist, If any of the
|
||||
other faces are missing the sans serif font will be used instead.
|
||||
|
||||
The compiled in default font file paths are specified within the
|
||||
build time Makefile.config. The default faces is the truetype DejaVu
|
||||
font set in the directory /usr/share/fonts/truetype/ttf-dejavu/
|
||||
|
||||
The font glyphs are, by default, rendered as 256 level transparency
|
||||
which gives excellent visual results even on small font sizes.
|
||||
|
||||
The default font is the Vera truetype font set. The default path they
|
||||
are sourced from is /usr/share/fonts/truetype/ttf-bitstream-vera/ .
|
||||
|
||||
The font selection may be changed by placing truetype font files
|
||||
in the resources path. The resource files will be the generic names
|
||||
sans_serif.ttf, sans_serif_bold.ttf etc. The selection may also be
|
||||
overridden by setting options.
|
||||
sans_serif.ttf, sans_serif_bold.ttf etc.
|
||||
|
||||
The font system is configured at run-time by several options. The
|
||||
fb_font_monochrome option causes the renderer to use monochrome
|
||||
glyph rendering which is faster to plot but slower to render and
|
||||
much less visually appealing. The remaining seven options control
|
||||
the files to be used for font faces.
|
||||
The font system is configured at run-time by several options:
|
||||
|
||||
fb_font_monochrome
|
||||
This option causes the renderer to use monochrome glyph
|
||||
rendering. This method of rendering is much less visually
|
||||
appealing and while faster to plot it is slower to render.
|
||||
|
||||
fb_font_cachesize
|
||||
This option sets the number of kilobytes of memory set aside for
|
||||
caching the rendered glyphs. This caching significantly improves
|
||||
the performance of using the freetype rendering system. It is set
|
||||
to 2048 by default (2 Megabytes of memory) which impiracle testing
|
||||
shows to be a suitable value for the seven default faces.
|
||||
|
||||
The remaining options control the files to be used for font faces. The
|
||||
font file name options will override both the compiled in paths and
|
||||
files found in the resource path.
|
||||
|
||||
fb_face_sans_serif - The sans serif face
|
||||
fb_face_sans_serif_bold - The bold sans serif face
|
||||
fb_face_sans_serif_italic - The italic sans serif face
|
||||
fb_face_sans_serif_italic_bold - The bold italic sans serif face.
|
||||
fb_face_monospace - The monospaced font
|
||||
fb_face_serif - The serif font
|
||||
fb_serif_bold - The bold serif font
|
||||
fb_face_serif_bold - The bold serif font
|
||||
fb_face_monospace - The monospaced font
|
||||
fb_face_monospace_bold - The bold monospaced font
|
||||
fb_face_cursive - The cursive font
|
||||
fb_face_fantasy - The fantasy font
|
||||
|
17
Makefile
17
Makefile
@ -559,7 +559,22 @@ ifeq ($(TARGET),framebuffer)
|
||||
NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
|
||||
NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
|
||||
|
||||
CFLAGS += -Dnsframebuffer '-DNETSURF_FB_RESPATH="$(NETSURF_FB_RESPATH_$(NETSURF_FB_FRONTEND))"'
|
||||
CFLAGS += -Dnsframebuffer
|
||||
|
||||
#resource path
|
||||
CFLAGS += '-DNETSURF_FB_RESPATH="$(NETSURF_FB_RESPATH_$(NETSURF_FB_FRONTEND))"'
|
||||
|
||||
# compile time font locations
|
||||
CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF="$(NETSURF_FB_FONT_SANS_SERIF)"'
|
||||
CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_BOLD="$(NETSURF_FB_FONT_SANS_SERIF_BOLD)"'
|
||||
CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_ITALIC="$(NETSURF_FB_FONT_SANS_SERIF_ITALIC)"'
|
||||
CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_ITALIC_BOLD="$(NETSURF_FB_FONT_SANS_SERIF_ITALIC_BOLD)"'
|
||||
CFLAGS += '-DNETSURF_FB_FONT_SERIF="$(NETSURF_FB_FONT_SERIF)"'
|
||||
CFLAGS += '-DNETSURF_FB_FONT_SERIF_BOLD="$(NETSURF_FB_FONT_SERIF_BOLD)"'
|
||||
CFLAGS += '-DNETSURF_FB_FONT_MONOSPACE="$(NETSURF_FB_FONT_MONOSPACE)"'
|
||||
CFLAGS += '-DNETSURF_FB_FONT_MONOSPACE_BOLD="$(NETSURF_FB_FONT_MONOSPACE_BOLD)"'
|
||||
CFLAGS += '-DNETSURF_FB_FONT_CURSIVE="$(NETSURF_FB_FONT_CURSIVE)"'
|
||||
CFLAGS += '-DNETSURF_FB_FONT_FANTASY="$(NETSURF_FB_FONT_FANTASY)"'
|
||||
|
||||
$(eval $(call pkg_config_find_and_add,ROSPRITE,librosprite,Sprite))
|
||||
$(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
|
||||
|
@ -232,9 +232,9 @@ ifeq ($(TARGET),framebuffer)
|
||||
# Optimisation levels
|
||||
CFLAGS += -O2 -Wuninitialized
|
||||
|
||||
# Framebuffer frontend.
|
||||
# Valid values are: linux, sdl, vnc, able
|
||||
NETSURF_FB_FRONTEND := linux
|
||||
# Framebuffer default surface provider.
|
||||
# Valid values are: x, sdl, linux, vnc, able,
|
||||
NETSURF_FB_FRONTEND := sdl
|
||||
|
||||
# Use libharu to enable PDF export and GTK printing support.
|
||||
# Valid options: YES, NO
|
||||
@ -248,12 +248,25 @@ ifeq ($(TARGET),framebuffer)
|
||||
# Valid options: internal, freetype
|
||||
NETSURF_FB_FONTLIB := internal
|
||||
|
||||
# freetype compiled in font locations
|
||||
NETSURF_FB_FONT_SANS_SERIF := /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf
|
||||
NETSURF_FB_FONT_SANS_SERIF_BOLD := /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf
|
||||
NETSURF_FB_FONT_SANS_SERIF_ITALIC := /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Oblique.ttf
|
||||
NETSURF_FB_FONT_SANS_SERIF_ITALIC_BOLD := /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-BoldOblique.ttf
|
||||
NETSURF_FB_FONT_SERIF := /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf
|
||||
NETSURF_FB_FONT_SERIF_BOLD := /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif-Bold.ttf
|
||||
NETSURF_FB_FONT_MONOSPACE := /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf
|
||||
NETSURF_FB_FONT_MONOSPACE_BOLD := /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Bold.ttf
|
||||
NETSURF_FB_FONT_CURSIVE := /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS.ttf
|
||||
NETSURF_FB_FONT_FANTASY := /usr/share/fonts/truetype/msttcorefonts/Impact.ttf
|
||||
|
||||
# Framebuffer frontends may have differing root paths for resources
|
||||
# As such, these specify the resource path and config path.
|
||||
NETSURF_FB_RESPATH_linux := $(PREFIX)/share/netsurf/
|
||||
NETSURF_FB_RESPATH_able := (tftpboot)/
|
||||
NETSURF_FB_RESPATH_dummy := ./
|
||||
NETSURF_FB_RESPATH_sdl := $(PREFIX)/share/netsurf/
|
||||
NETSURF_FB_RESPATH_x := $(PREFIX)/share/netsurf/
|
||||
NETSURF_FB_RESPATH_vnc := $(PREFIX)/share/netsurf/
|
||||
|
||||
NETSURF_FRAMEBUFFER_RESOURCES = $(NETSURF_FB_RESPATH_$(NETSURF_FB_FRONTEND))
|
||||
|
@ -34,7 +34,10 @@
|
||||
#include "framebuffer/options.h"
|
||||
#include "framebuffer/findfile.h"
|
||||
|
||||
#define DEJAVU_PATH "/usr/share/fonts/truetype/ttf-dejavu/"
|
||||
/* glyph cache minimum size */
|
||||
#define CACHE_MIN_SIZE (100 * 1024)
|
||||
|
||||
#define BOLD_WEIGHT 700
|
||||
|
||||
static FT_Library library;
|
||||
static FTC_Manager ft_cmanager;
|
||||
@ -50,18 +53,23 @@ typedef struct fb_faceid_s {
|
||||
int cidx; /* character map index for unicode */
|
||||
} fb_faceid_t;
|
||||
|
||||
|
||||
enum fb_face_e {
|
||||
FB_FACE_SANS_SERIF = 0,
|
||||
FB_FACE_SANS_SERIF_BOLD = 1,
|
||||
FB_FACE_SANS_SERIF_ITALIC = 2,
|
||||
FB_FACE_SANS_SERIF_ITALIC_BOLD = 3,
|
||||
FB_FACE_SERIF = 4,
|
||||
FB_FACE_SERIF_BOLD = 5,
|
||||
FB_FACE_MONOSPACE = 6,
|
||||
FB_FACE_MONOSPACE_BOLD = 7,
|
||||
FB_FACE_CURSIVE = 8,
|
||||
FB_FACE_FANTASY = 9,
|
||||
};
|
||||
|
||||
/* defines for accesing the faces */
|
||||
#define FB_FACE_DEFAULT 0
|
||||
|
||||
#define FB_FACE_SANS_SERIF 0
|
||||
#define FB_FACE_SANS_SERIF_BOLD 1
|
||||
#define FB_FACE_SANS_SERIF_ITALIC 2
|
||||
#define FB_FACE_SANS_SERIF_ITALIC_BOLD 3
|
||||
#define FB_FACE_MONOSPACE 4
|
||||
#define FB_FACE_SERIF 5
|
||||
#define FB_FACE_SERIF_BOLD 6
|
||||
|
||||
#define FB_FACE_COUNT 7
|
||||
#define FB_FACE_COUNT 10
|
||||
|
||||
static fb_faceid_t *fb_faces[FB_FACE_COUNT];
|
||||
|
||||
@ -124,7 +132,7 @@ fb_new_face(const char *option, const char *resname, const char *fontfile)
|
||||
if (error) {
|
||||
LOG(("Could not find font face %s (code %d)\n", fontfile, error));
|
||||
free(newf);
|
||||
newf = fb_faces[FB_FACE_DEFAULT]; /* use default */
|
||||
newf = NULL;
|
||||
}
|
||||
|
||||
return newf;
|
||||
@ -136,6 +144,7 @@ bool fb_font_init(void)
|
||||
FT_Error error;
|
||||
FT_ULong max_cache_size;
|
||||
FT_UInt max_faces = 6;
|
||||
fb_faceid_t *fb_face;
|
||||
|
||||
/* freetype library initialise */
|
||||
error = FT_Init_FreeType( &library );
|
||||
@ -144,7 +153,12 @@ bool fb_font_init(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
max_cache_size = 2 * 1024 *1024; /* 2MB should be enough */
|
||||
/* set the Glyph cache size up */
|
||||
max_cache_size = option_fb_font_cachesize * 1024;
|
||||
|
||||
if (max_cache_size < CACHE_MIN_SIZE) {
|
||||
max_cache_size = CACHE_MIN_SIZE;
|
||||
}
|
||||
|
||||
/* cache manager initialise */
|
||||
error = FTC_Manager_New(library,
|
||||
@ -164,47 +178,122 @@ bool fb_font_init(void)
|
||||
|
||||
error = FTC_ImageCache_New(ft_cmanager, &ft_image_cache);
|
||||
|
||||
fb_faces[FB_FACE_SANS_SERIF] = NULL;
|
||||
fb_faces[FB_FACE_SANS_SERIF] =
|
||||
fb_new_face(option_fb_face_sans_serif,
|
||||
"sans_serif.ttf",
|
||||
DEJAVU_PATH"DejaVuSans.ttf");
|
||||
if (fb_faces[FB_FACE_SANS_SERIF] == NULL) {
|
||||
LOG(("Could not find default font (code %d)\n", error));
|
||||
FTC_Manager_Done(ft_cmanager );
|
||||
/* need to obtain the generic font faces */
|
||||
|
||||
/* Start with the sans serif font */
|
||||
fb_face = fb_new_face(option_fb_face_sans_serif,
|
||||
"sans_serif.ttf",
|
||||
NETSURF_FB_FONT_SANS_SERIF);
|
||||
if (fb_face == NULL) {
|
||||
/* The sans serif font is the default and must be found. */
|
||||
LOG(("Could not find the default font\n"));
|
||||
FTC_Manager_Done(ft_cmanager);
|
||||
FT_Done_FreeType(library);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
fb_faces[FB_FACE_SANS_SERIF] = fb_face;
|
||||
}
|
||||
|
||||
fb_faces[FB_FACE_SANS_SERIF_BOLD] =
|
||||
fb_new_face(option_fb_face_sans_serif_bold,
|
||||
/* Bold sans serif face */
|
||||
fb_face = fb_new_face(option_fb_face_sans_serif_bold,
|
||||
"sans_serif_bold.ttf",
|
||||
DEJAVU_PATH"DejaVuSans-Bold.ttf");
|
||||
NETSURF_FB_FONT_SANS_SERIF_BOLD);
|
||||
if (fb_face == NULL) {
|
||||
/* seperate bold face unavailabe use the normal weight version */
|
||||
fb_faces[FB_FACE_SANS_SERIF_BOLD] = fb_faces[FB_FACE_SANS_SERIF];
|
||||
} else {
|
||||
fb_faces[FB_FACE_SANS_SERIF_BOLD] = fb_face;
|
||||
}
|
||||
|
||||
fb_faces[FB_FACE_SANS_SERIF_ITALIC] =
|
||||
fb_new_face(option_fb_face_sans_serif_italic,
|
||||
"sans_serif_italic.ttf",
|
||||
DEJAVU_PATH"DejaVuSans-Oblique.ttf");
|
||||
/* Italic sans serif face */
|
||||
fb_face = fb_new_face(option_fb_face_sans_serif_italic,
|
||||
"sans_serif_italic.ttf",
|
||||
NETSURF_FB_FONT_SANS_SERIF_ITALIC);
|
||||
if (fb_face == NULL) {
|
||||
/* seperate italic face unavailabe use the normal weight version */
|
||||
fb_faces[FB_FACE_SANS_SERIF_ITALIC] = fb_faces[FB_FACE_SANS_SERIF];
|
||||
} else {
|
||||
fb_faces[FB_FACE_SANS_SERIF_ITALIC] = fb_face;
|
||||
}
|
||||
|
||||
fb_faces[FB_FACE_SANS_SERIF_ITALIC_BOLD] =
|
||||
fb_new_face(option_fb_face_sans_serif_italic_bold,
|
||||
"sans_serif_italic_bold.ttf",
|
||||
DEJAVU_PATH"DejaVuSans-BoldOblique.ttf");
|
||||
/* Bold italic sans serif face */
|
||||
fb_face = fb_new_face(option_fb_face_sans_serif_italic_bold,
|
||||
"sans_serif_italic_bold.ttf",
|
||||
NETSURF_FB_FONT_SANS_SERIF_ITALIC_BOLD);
|
||||
if (fb_face == NULL) {
|
||||
/* seperate italic face unavailabe use the normal weight version */
|
||||
fb_faces[FB_FACE_SANS_SERIF_ITALIC_BOLD] = fb_faces[FB_FACE_SANS_SERIF];
|
||||
} else {
|
||||
fb_faces[FB_FACE_SANS_SERIF_ITALIC_BOLD] = fb_face;
|
||||
}
|
||||
|
||||
fb_faces[FB_FACE_MONOSPACE] =
|
||||
fb_new_face(option_fb_face_monospace,
|
||||
"monospace.ttf",
|
||||
DEJAVU_PATH"DejaVuSansMono.ttf");
|
||||
|
||||
fb_faces[FB_FACE_SERIF] =
|
||||
fb_new_face(option_fb_face_serif,
|
||||
/* serif face */
|
||||
fb_face = fb_new_face(option_fb_face_serif,
|
||||
"serif.ttf",
|
||||
DEJAVU_PATH"DejaVuSerif.ttf");
|
||||
NETSURF_FB_FONT_SERIF);
|
||||
if (fb_face == NULL) {
|
||||
/* serif face unavailabe use the default */
|
||||
fb_faces[FB_FACE_SERIF] = fb_faces[FB_FACE_SANS_SERIF];
|
||||
} else {
|
||||
fb_faces[FB_FACE_SERIF] = fb_face;
|
||||
}
|
||||
|
||||
/* bold serif face*/
|
||||
fb_face = fb_new_face(option_fb_face_serif_bold,
|
||||
"serif_bold.ttf",
|
||||
NETSURF_FB_FONT_SERIF_BOLD);
|
||||
if (fb_face == NULL) {
|
||||
/* bold serif face unavailabe use the normal weight */
|
||||
fb_faces[FB_FACE_SERIF_BOLD] = fb_faces[FB_FACE_SERIF];
|
||||
} else {
|
||||
fb_faces[FB_FACE_SERIF_BOLD] = fb_face;
|
||||
}
|
||||
|
||||
|
||||
/* monospace face */
|
||||
fb_face = fb_new_face(option_fb_face_monospace,
|
||||
"monospace.ttf",
|
||||
NETSURF_FB_FONT_MONOSPACE);
|
||||
if (fb_face == NULL) {
|
||||
/* serif face unavailabe use the default */
|
||||
fb_faces[FB_FACE_MONOSPACE] = fb_faces[FB_FACE_SANS_SERIF];
|
||||
} else {
|
||||
fb_faces[FB_FACE_MONOSPACE] = fb_face;
|
||||
}
|
||||
|
||||
/* bold monospace face*/
|
||||
fb_face = fb_new_face(option_fb_face_monospace_bold,
|
||||
"monospace_bold.ttf",
|
||||
NETSURF_FB_FONT_MONOSPACE_BOLD);
|
||||
if (fb_face == NULL) {
|
||||
/* bold serif face unavailabe use the normal weight */
|
||||
fb_faces[FB_FACE_MONOSPACE_BOLD] = fb_faces[FB_FACE_MONOSPACE];
|
||||
} else {
|
||||
fb_faces[FB_FACE_MONOSPACE_BOLD] = fb_face;
|
||||
}
|
||||
|
||||
/* cursive face */
|
||||
fb_face = fb_new_face(option_fb_face_cursive,
|
||||
"cursive.ttf",
|
||||
NETSURF_FB_FONT_CURSIVE);
|
||||
if (fb_face == NULL) {
|
||||
/* cursive face unavailabe use the default */
|
||||
fb_faces[FB_FACE_CURSIVE] = fb_faces[FB_FACE_SANS_SERIF];
|
||||
} else {
|
||||
fb_faces[FB_FACE_CURSIVE] = fb_face;
|
||||
}
|
||||
|
||||
/* fantasy face */
|
||||
fb_face = fb_new_face(option_fb_face_fantasy,
|
||||
"fantasy.ttf",
|
||||
NETSURF_FB_FONT_FANTASY);
|
||||
if (fb_face == NULL) {
|
||||
/* fantasy face unavailabe use the default */
|
||||
fb_faces[FB_FACE_FANTASY] = fb_faces[FB_FACE_SANS_SERIF];
|
||||
} else {
|
||||
fb_faces[FB_FACE_FANTASY] = fb_face;
|
||||
}
|
||||
|
||||
fb_faces[FB_FACE_SERIF_BOLD] =
|
||||
fb_new_face(option_fb_face_serif_bold,
|
||||
"serif_bold.ttf",
|
||||
DEJAVU_PATH"DejaVuSerif-Bold.ttf");
|
||||
|
||||
/* set the default render mode */
|
||||
if (option_fb_font_monochrome == true)
|
||||
@ -227,37 +316,46 @@ static void fb_fill_scalar(const plot_font_style_t *fstyle, FTC_Scaler srec)
|
||||
int selected_face = FB_FACE_DEFAULT;
|
||||
|
||||
switch (fstyle->family) {
|
||||
/*
|
||||
case PLOT_FONT_FAMILY_CURSIVE:
|
||||
break;
|
||||
case PLOT_FONT_FAMILY_FANTASY:
|
||||
break;
|
||||
*/
|
||||
|
||||
case PLOT_FONT_FAMILY_SERIF:
|
||||
if (fstyle->weight >= 700)
|
||||
if (fstyle->weight >= BOLD_WEIGHT) {
|
||||
selected_face = FB_FACE_SERIF_BOLD;
|
||||
else
|
||||
} else {
|
||||
selected_face = FB_FACE_SERIF;
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case PLOT_FONT_FAMILY_MONOSPACE:
|
||||
selected_face = FB_FACE_MONOSPACE;
|
||||
if (fstyle->weight >= BOLD_WEIGHT) {
|
||||
selected_face = FB_FACE_MONOSPACE_BOLD;
|
||||
} else {
|
||||
selected_face = FB_FACE_MONOSPACE;
|
||||
}
|
||||
break;
|
||||
|
||||
case PLOT_FONT_FAMILY_CURSIVE:
|
||||
selected_face = FB_FACE_CURSIVE;
|
||||
break;
|
||||
|
||||
case PLOT_FONT_FAMILY_FANTASY:
|
||||
selected_face = FB_FACE_FANTASY;
|
||||
break;
|
||||
|
||||
case PLOT_FONT_FAMILY_SANS_SERIF:
|
||||
default:
|
||||
if ((fstyle->flags & FONTF_ITALIC) ||
|
||||
(fstyle->flags & FONTF_OBLIQUE)) {
|
||||
if (fstyle->weight >= 700)
|
||||
(fstyle->flags & FONTF_OBLIQUE)) {
|
||||
if (fstyle->weight >= BOLD_WEIGHT) {
|
||||
selected_face = FB_FACE_SANS_SERIF_ITALIC_BOLD;
|
||||
else
|
||||
} else {
|
||||
selected_face = FB_FACE_SANS_SERIF_ITALIC;
|
||||
}
|
||||
} else {
|
||||
if (fstyle->weight >= 700)
|
||||
if (fstyle->weight >= BOLD_WEIGHT) {
|
||||
selected_face = FB_FACE_SANS_SERIF_BOLD;
|
||||
else
|
||||
} else {
|
||||
selected_face = FB_FACE_SANS_SERIF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,25 +21,43 @@
|
||||
|
||||
#include "desktop/options.h"
|
||||
|
||||
/* surface options */
|
||||
|
||||
extern int option_fb_depth;
|
||||
extern int option_fb_refresh;
|
||||
extern char *option_fb_device;
|
||||
extern char *option_fb_input_devpath;
|
||||
extern char *option_fb_input_glob;
|
||||
|
||||
/* toolkit options */
|
||||
|
||||
extern int option_fb_furniture_size; /* toolkit furniture size */
|
||||
extern int option_fb_toolbar_size; /* toolbar furniture size */
|
||||
extern char *option_fb_toolbar_layout; /* toolbar layout */
|
||||
extern bool option_fb_osk; /* enable on screen keyboard */
|
||||
|
||||
extern bool option_fb_font_monochrome; /* render font monochrome */
|
||||
/* font options */
|
||||
|
||||
/* render font monochrome */
|
||||
extern bool option_fb_font_monochrome;
|
||||
/** size of font glyph cache in kilobytes. */
|
||||
extern int option_fb_font_cachesize;
|
||||
|
||||
extern char *option_fb_face_sans_serif; /* default sans face */
|
||||
extern char *option_fb_face_sans_serif_bold; /* bold sans face */
|
||||
extern char *option_fb_face_sans_serif_italic; /* bold sans face */
|
||||
extern char *option_fb_face_sans_serif_italic_bold; /* bold sans face */
|
||||
extern char *option_fb_face_monospace; /* monospace face */
|
||||
|
||||
extern char *option_fb_face_serif; /* serif face */
|
||||
extern char *option_fb_face_serif_bold; /* bold serif face */
|
||||
|
||||
extern char *option_fb_face_monospace; /* monospace face */
|
||||
extern char *option_fb_face_monospace_bold; /* bold monospace face */
|
||||
|
||||
extern char *option_fb_face_cursive; /* cursive face */
|
||||
extern char *option_fb_face_fantasy; /* fantasy face */
|
||||
|
||||
|
||||
#define EXTRA_OPTION_DEFINE \
|
||||
int option_fb_depth = 32; \
|
||||
int option_fb_refresh = 70; \
|
||||
@ -51,13 +69,17 @@ extern char *option_fb_face_serif_bold; /* bold serif face */
|
||||
char *option_fb_toolbar_layout; \
|
||||
bool option_fb_osk = false; \
|
||||
bool option_fb_font_monochrome = false; \
|
||||
int option_fb_font_cachesize = 2048; \
|
||||
char *option_fb_face_sans_serif; \
|
||||
char *option_fb_face_sans_serif_bold; \
|
||||
char *option_fb_face_sans_serif_italic; \
|
||||
char *option_fb_face_sans_serif_italic_bold; \
|
||||
char *option_fb_face_monospace; \
|
||||
char *option_fb_face_serif; \
|
||||
char *option_fb_face_serif_bold;
|
||||
char *option_fb_face_serif_bold; \
|
||||
char *option_fb_face_monospace; \
|
||||
char *option_fb_face_monospace_bold; \
|
||||
char *option_fb_face_cursive; \
|
||||
char *option_fb_face_fantasy;
|
||||
|
||||
#define EXTRA_OPTION_TABLE \
|
||||
{ "fb_depth", OPTION_INTEGER, &option_fb_depth }, \
|
||||
@ -70,13 +92,17 @@ extern char *option_fb_face_serif_bold; /* bold serif face */
|
||||
{ "fb_toolbar_layout", OPTION_STRING, &option_fb_toolbar_layout }, \
|
||||
{ "fb_osk", OPTION_BOOL, &option_fb_osk }, \
|
||||
{ "fb_font_monochrome", OPTION_BOOL, &option_fb_font_monochrome }, \
|
||||
{ "fb_font_cachesize", OPTION_INTEGER, &option_fb_font_cachesize }, \
|
||||
{ "fb_face_sans_serif", OPTION_STRING, &option_fb_face_sans_serif }, \
|
||||
{ "fb_face_sans_serif_bold", OPTION_STRING, &option_fb_face_sans_serif_bold }, \
|
||||
{ "fb_face_sans_serif_italic", OPTION_STRING, &option_fb_face_sans_serif_italic }, \
|
||||
{ "fb_face_sans_serif_italic_bold", OPTION_STRING, &option_fb_face_sans_serif_italic_bold }, \
|
||||
{ "fb_face_monospace", OPTION_STRING, &option_fb_face_monospace }, \
|
||||
{ "fb_face_serif", OPTION_STRING, &option_fb_face_serif }, \
|
||||
{ "fb_serif_bold", OPTION_STRING, &option_fb_face_serif_bold }
|
||||
{ "fb_serif_bold", OPTION_STRING, &option_fb_face_serif_bold }, \
|
||||
{ "fb_face_monospace", OPTION_STRING, &option_fb_face_monospace }, \
|
||||
{ "fb_face_monospace_bold", OPTION_STRING, &option_fb_face_monospace_bold }, \
|
||||
{ "fb_face_cursive", OPTION_STRING, &option_fb_face_cursive }, \
|
||||
{ "fb_face_fantasy", OPTION_STRING, &option_fb_face_fantasy }
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user