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;
|
} uiDrawTextStretch;
|
||||||
|
|
||||||
struct uiDrawTextStyle {
|
struct uiDrawTextStyle {
|
||||||
// TODO Language attribute
|
|
||||||
const char *Family;
|
const char *Family;
|
||||||
double Size;
|
double Size;
|
||||||
uiDrawTextWeight Weight;
|
uiDrawTextWeight Weight;
|
||||||
|
@ -522,6 +521,7 @@ struct uiDrawTextStyle {
|
||||||
double UnderlineG;
|
double UnderlineG;
|
||||||
double UnderlineB;
|
double UnderlineB;
|
||||||
double UnderlineA; // TODO Pango
|
double UnderlineA; // TODO Pango
|
||||||
|
const char *Language; // RFC 3066; NULL for default
|
||||||
// TODO other Pango attributes
|
// TODO other Pango attributes
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -560,6 +560,9 @@ void uiDrawText(uiDrawContext *c, double x, double y, const char *text, uiDrawTe
|
||||||
if (style->HasUnderline) {
|
if (style->HasUnderline) {
|
||||||
// TODO
|
// 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);
|
layout = pango_cairo_create_layout(c->cr);
|
||||||
pango_layout_set_text(layout, text, -1);
|
pango_layout_set_text(layout, text, -1);
|
||||||
|
|
Loading…
Reference in New Issue