From 0db03e5f440fadeeca9e73d428983240fb1a9000 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 24 Feb 2017 12:26:04 -0500 Subject: [PATCH] More TODO and documentation cleanup, including removing redundant or now-pointless TODOs. --- _future/verticaltext/README | 2 ++ ui_attrstr.h | 18 +++++++----------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/_future/verticaltext/README b/_future/verticaltext/README index 7f30a15c..99310823 100644 --- a/_future/verticaltext/README +++ b/_future/verticaltext/README @@ -15,3 +15,5 @@ https://www.w3.org/TR/REC-CSS2/notes.html TODO indicate where in the attributes.c file that block of code should go (or drop it entirely for the reasons listed above) TODO same for ui.h + +TODO vertical carets diff --git a/ui_attrstr.h b/ui_attrstr.h index 0fb4a586..6f23fa0c 100644 --- a/ui_attrstr.h +++ b/ui_attrstr.h @@ -276,7 +276,6 @@ _UI_ENUM(uiDrawTextStretch) { struct uiDrawFontDescriptor { char *Family; - // TODO rename to PointSize? double Size; uiDrawTextWeight Weight; uiDrawTextItalic Italic; @@ -301,9 +300,15 @@ struct uiDrawTextLayoutParams { uiDrawTextLayoutAlign Align; }; +// Height will equal ParagraphSpacingBefore + LineHeightSpace + Ascent + Descent + Leading + LineSpacing + ParagraphSpacing. +// The above values are listed in vertical order, from top to bottom. +// Ascent + Descent + Leading will give you the typographic bounds +// of the text. BaselineY is the boundary between Ascent and Descent. +// X, Y, and BaselineY are all in the layout's coordinate system, so the +// start point of the baseline will be at (X, BaselineY). All values are +// nonnegative. struct uiDrawTextLayoutLineMetrics { // This describes the overall bounding box of the line. - // TODO figure out if X is correct regardless of both alignment and writing direction double X; double Y; double Width; @@ -322,13 +327,6 @@ struct uiDrawTextLayoutLineMetrics { double LineSpacing; double ParagraphSpacing; - // Height should equal ParagraphSpacingBefore + LineHeightSpace + Ascent + Descent + Leading + LineSpacing + ParagraphSpacing. - // The above values are listed in vertical order, from top to bottom. - // Ascent + Descent + Leading will give you the typographic bounds of the text. - // BaselineY will be the boundary between Ascent and Descent. - // X, Y, and BaselineY are all in the layout's coordinate system, so the start point of the baseline will be at (X, BaselineY). - // All values will be nonnegative. - // TODO trailing whitespace? }; @@ -375,13 +373,11 @@ _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 _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); // TODO allow blinking typedef struct uiFontButton uiFontButton; #define uiFontButton(this) ((uiFontButton *) (this)) -// TODO document this returns a new font _UI_EXTERN void uiFontButtonFont(uiFontButton *b, uiDrawFontDescriptor *desc); // TOOD SetFont, mechanics _UI_EXTERN void uiFontButtonOnChanged(uiFontButton *b, void (*f)(uiFontButton *, void *), void *data);