Added the Language field to the text styles list.
This commit is contained in:
parent
6ef404c2dd
commit
353afcd464
2
ui.h
2
ui.h
|
@ -496,7 +496,6 @@ typedef enum uiDrawTextStretch {
|
|||
} uiDrawTextStretch;
|
||||
|
||||
struct uiDrawTextStyle {
|
||||
// TODO Language attribute
|
||||
const char *Family;
|
||||
double Size;
|
||||
uiDrawTextWeight Weight;
|
||||
|
@ -522,6 +521,7 @@ struct uiDrawTextStyle {
|
|||
double UnderlineG;
|
||||
double UnderlineB;
|
||||
double UnderlineA; // TODO Pango
|
||||
const char *Language; // RFC 3066; NULL for default
|
||||
// TODO other Pango attributes
|
||||
};
|
||||
|
||||
|
|
|
@ -560,6 +560,9 @@ void uiDrawText(uiDrawContext *c, double x, double y, const char *text, uiDrawTe
|
|||
if (style->HasUnderline) {
|
||||
// TODO
|
||||
}
|
||||
if (style->Language != NULL)
|
||||
pango_attr_list_insert(attrs,
|
||||
pango_attr_language_new(pango_language_from_string(style->Language)));
|
||||
|
||||
layout = pango_cairo_create_layout(c->cr);
|
||||
pango_layout_set_text(layout, text, -1);
|
||||
|
|
Loading…
Reference in New Issue