More attribute work, including trimming unsupported or nonsensical attributes.
This commit is contained in:
parent
250cba7c67
commit
eb7dfa5cc4
44
ui_attrstr.h
44
ui_attrstr.h
|
@ -28,38 +28,13 @@ _UI_ENUM(uiAttribute) {
|
||||||
|
|
||||||
// TODO kCTStrokeWidthAttributeName/kCTStrokeColorAttributeName? doesn't seem to be present anywhere else?
|
// TODO kCTStrokeWidthAttributeName/kCTStrokeColorAttributeName? doesn't seem to be present anywhere else?
|
||||||
|
|
||||||
// TODO underline styles
|
uiAttributeUnderline, // enum uiDrawUnderlineStyle
|
||||||
// OS X: kCTUnderlineStyleAttributeName
|
uiAttributeUnderlineColor, // enum uiDrawUnderlineColor
|
||||||
// none, single, thick, or double
|
|
||||||
// styles: solid, dot, dash, dash dot, dash dot dot
|
|
||||||
// Pango: pango_attr_underline_new()
|
|
||||||
// none, single, double, low single, or wavy/error
|
|
||||||
// DirectWrite: only ever defined in version 1
|
|
||||||
// none or single only
|
|
||||||
// we could do this with a custom renderer (see Petzold's articles; he does it there)
|
|
||||||
|
|
||||||
// TODO kCTUnderlineColorAttributeName
|
|
||||||
// OS X: RGBA
|
|
||||||
// Pango: RGB(? TODO check for A in newer versions)
|
|
||||||
// DirectWrite: none; unsure if this means "same as text color" or "black only" (I assume Direct2D decides)
|
|
||||||
// we could do this with a custom renderer (see Petzold's articles; he does it there)
|
|
||||||
|
|
||||||
// TODO kCTSuperscriptAttributeName vs below
|
// TODO kCTSuperscriptAttributeName vs below
|
||||||
|
|
||||||
// TODO compare kCTVerticalFormsAttributeName to below?
|
|
||||||
|
|
||||||
// TODO kCTGlyphInfoAttributeName
|
|
||||||
|
|
||||||
// TODO kCTCharacterShapeAttributeName (seems to be provided by pango as well)
|
|
||||||
|
|
||||||
// TODO kCTLanguageAttributeName?
|
|
||||||
|
|
||||||
// TODO kCTRunDelegateAttributeName?
|
|
||||||
|
|
||||||
// TODO kCTBaselineClassAttributeName, kCTBaselineInfoAttributeName, kCTBaselineReferenceInfoAttributeName
|
// TODO kCTBaselineClassAttributeName, kCTBaselineInfoAttributeName, kCTBaselineReferenceInfoAttributeName
|
||||||
|
|
||||||
// TODO kCTWritingDirectionAttributeName?
|
|
||||||
|
|
||||||
// TODO kCTRubyAnnotationAttributeName vs below
|
// TODO kCTRubyAnnotationAttributeName vs below
|
||||||
|
|
||||||
// TODO strikethroughs? (pango yes, directwrite yes, os x no)
|
// TODO strikethroughs? (pango yes, directwrite yes, os x no)
|
||||||
|
@ -215,6 +190,20 @@ _UI_ENUM(uiAttribute) {
|
||||||
// TODO uiAttributeCustom,
|
// TODO uiAttributeCustom,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
_UI_ENUM(uiDrawUnderlineStyle) {
|
||||||
|
uiDrawUnderlineStyleNone,
|
||||||
|
uiDrawUnderlineStyleSingle,
|
||||||
|
uiDrawUnderlineStyleDouble,
|
||||||
|
uiDrawUnderlineStyleSuggestion, // wavy or dotted underlines used for spelling/grammar checkers
|
||||||
|
};
|
||||||
|
|
||||||
|
_UI_ENUM(uiDrawUnderlineColor) {
|
||||||
|
uiDrawUnderlineColorCustom, // also use R/G/B/A fields
|
||||||
|
uiDrawUnderlineColorSpelling,
|
||||||
|
uiDrawUnderlineColorGrammar,
|
||||||
|
uiDrawUnderlineColorAuxiliary, // for instance, the color used by smart replacements on OS X
|
||||||
|
};
|
||||||
|
|
||||||
_UI_ENUM(uiAttributeFractionForm) {
|
_UI_ENUM(uiAttributeFractionForm) {
|
||||||
uiAttributeFractionFormNone,
|
uiAttributeFractionFormNone,
|
||||||
uiAttributeFractionFormVertical,
|
uiAttributeFractionFormVertical,
|
||||||
|
@ -402,6 +391,7 @@ _UI_EXTERN void uiDrawTextLayoutHitTest(uiDrawTextLayout *tl, double x, double y
|
||||||
// TODO make sure this works right for right-aligned and center-aligned lines and justified lines and RTL text
|
// TODO make sure this works right for right-aligned and center-aligned lines and justified lines and RTL text
|
||||||
_UI_EXTERN double uiDrawTextLayoutByteLocationInLine(uiDrawTextLayout *tl, size_t pos, int line);
|
_UI_EXTERN double uiDrawTextLayoutByteLocationInLine(uiDrawTextLayout *tl, size_t pos, int line);
|
||||||
|
|
||||||
|
// TODO vertical carets
|
||||||
_UI_EXTERN void uiDrawCaret(uiDrawContext *c, double x, double y, uiDrawTextLayout *layout, size_t pos, int *line);
|
_UI_EXTERN void uiDrawCaret(uiDrawContext *c, double x, double y, uiDrawTextLayout *layout, size_t pos, int *line);
|
||||||
// TODO allow blinking
|
// TODO allow blinking
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue