mirror of
https://github.com/labwc/labwc.git
synced 2025-10-31 22:25:34 -04:00
Add support for all Pango font weight options
This commit is contained in:
parent
44295c0c13
commit
6a810ad762
3 changed files with 72 additions and 4 deletions
|
|
@ -862,8 +862,31 @@ set_font_attr(struct font *font, const char *nodename, const char *content)
|
|||
font->slant = FONT_SLANT_NORMAL;
|
||||
}
|
||||
} else if (!strcmp(nodename, "weight")) {
|
||||
font->weight = !strcasecmp(content, "bold") ?
|
||||
FONT_WEIGHT_BOLD : FONT_WEIGHT_NORMAL;
|
||||
if (!strcasecmp(content, "thin")) {
|
||||
font->weight = FONT_WEIGHT_THIN;
|
||||
} else if (!strcasecmp(content, "ultralight")) {
|
||||
font->weight = FONT_WEIGHT_ULTRALIGHT;
|
||||
} else if (!strcasecmp(content, "light")) {
|
||||
font->weight = FONT_WEIGHT_LIGHT;
|
||||
} else if (!strcasecmp(content, "semilight")) {
|
||||
font->weight = FONT_WEIGHT_SEMILIGHT;
|
||||
} else if (!strcasecmp(content, "book")) {
|
||||
font->weight = FONT_WEIGHT_BOOK;
|
||||
} else if (!strcasecmp(content, "medium")) {
|
||||
font->weight = FONT_WEIGHT_MEDIUM;
|
||||
} else if (!strcasecmp(content, "semibold")) {
|
||||
font->weight = FONT_WEIGHT_SEMIBOLD;
|
||||
} else if (!strcasecmp(content, "bold")) {
|
||||
font->weight = FONT_WEIGHT_BOLD;
|
||||
} else if (!strcasecmp(content, "ultrabold")) {
|
||||
font->weight = FONT_WEIGHT_ULTRABOLD;
|
||||
} else if (!strcasecmp(content, "heavy")) {
|
||||
font->weight = FONT_WEIGHT_HEAVY;
|
||||
} else if (!strcasecmp(content, "ultraheavy")) {
|
||||
font->weight = FONT_WEIGHT_ULTRAHEAVY;
|
||||
} else {
|
||||
font->weight = FONT_WEIGHT_NORMAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue