Started dropping the whole features system in favor of a homogenous OpenType feature attribute just like every other API. Will make some things easier, hopefully...

This commit is contained in:
Pietro Gagliardi 2017-05-07 10:30:08 -04:00
parent df2a726c1b
commit a0454a6b43
1 changed files with 20 additions and 0 deletions

View File

@ -32,6 +32,10 @@ _UI_ENUM(uiAttribute) {
// TODO document that the color in the case we don't specify it is the text color
uiAttributeUnderlineColor, // enum uiDrawUnderlineColor
uiAttributeFeatures, // object of type uiOpenTypeFeatures
#if 0
// These attributes represent typographic features. Each feature
// is a separate attribute, to make composition easier. The
// availability of for each attribute are defined by the font; the
@ -154,6 +158,8 @@ _UI_ENUM(uiAttribute) {
uiAttributeLowercaseCapForms, // enum uiAttributeCapForm
uiAttributeUppercaseCapForms, // enum uiAttributeCapForm
};
#endif
};
_UI_ENUM(uiDrawUnderlineStyle) {
uiDrawUnderlineStyleNone,
@ -169,6 +175,8 @@ _UI_ENUM(uiDrawUnderlineColor) {
uiDrawUnderlineColorAuxiliary, // for instance, the color used by smart replacements on OS X
};
#if 0
_UI_ENUM(uiAttributeNumberSpacing) {
uiAttributeNumberSpacingProportional,
// AAT calls this "monospaced"
@ -208,6 +216,18 @@ _UI_ENUM(uiAttributeCapForm) {
uiAttributeCapFormPetiteCaps,
};
#endif
// TODO rename?
typedef struct uiOpenTypeFeatures uiOpenTypeFeatures;
// TODO detailed constructor?
_UI_EXTERN uiOpenTypeFeatures *uiNewOpenTypeFeatures(void);
_UI_EXTERN void uiFreeOpenTypeFeatures(uiOpenTypeFeatures *otf);
_UI_EXTERN uiOpenTypeFeatures *uiOpenTypeFeaturesClone(uiOpenTypeFeatures *otf);
_UI_EXTERN void uiOpenTypeFeaturesAdd(uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t value);
// TODO remove, query, enumerate
// TODO make the compare function public?
typedef struct uiAttributeSpec uiAttributeSpec;
struct uiAttributeSpec {