Actually let's do paragraph alignment first. Haven't tested hit-test with that just yet.
This commit is contained in:
parent
dca92d507e
commit
491ec3ae49
16
ui_attrstr.h
16
ui_attrstr.h
|
@ -86,8 +86,22 @@ struct uiDrawFontDescriptor {
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct uiDrawTextLayout uiDrawTextLayout;
|
typedef struct uiDrawTextLayout uiDrawTextLayout;
|
||||||
|
typedef struct uiDrawTextLayoutParams uiDrawTextLayoutParams;
|
||||||
typedef struct uiDrawTextLayoutLineMetrics uiDrawTextLayoutLineMetrics;
|
typedef struct uiDrawTextLayoutLineMetrics uiDrawTextLayoutLineMetrics;
|
||||||
|
|
||||||
|
_UI_ENUM(uiDrawTextLayoutAlign) {
|
||||||
|
uiDrawTextLayoutAlignLeft,
|
||||||
|
uiDrawTextLayoutAlignCenter,
|
||||||
|
uiDrawTextLayoutAlignRight,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct uiDrawTextLayoutParams {
|
||||||
|
uiAttributedString *String;
|
||||||
|
uiDrawFontDescriptor *DefaultFont;
|
||||||
|
double Width;
|
||||||
|
uiDrawTextLayoutAlign Align;
|
||||||
|
};
|
||||||
|
|
||||||
struct uiDrawTextLayoutLineMetrics {
|
struct uiDrawTextLayoutLineMetrics {
|
||||||
// This describes the overall bounding box of the line.
|
// This describes the overall bounding box of the line.
|
||||||
// TODO figure out if X is correct regardless of both alignment and writing direction
|
// TODO figure out if X is correct regardless of both alignment and writing direction
|
||||||
|
@ -128,7 +142,7 @@ struct uiDrawTextLayoutLineMetrics {
|
||||||
// - uiDrawTextLayoutRangeForSize() (returns what substring would fit in a given size)
|
// - uiDrawTextLayoutRangeForSize() (returns what substring would fit in a given size)
|
||||||
// - uiDrawTextLayoutNewWithHeight() (limits amount of string used by the height)
|
// - uiDrawTextLayoutNewWithHeight() (limits amount of string used by the height)
|
||||||
// - some function to fix up a range (for text editing)
|
// - some function to fix up a range (for text editing)
|
||||||
_UI_EXTERN uiDrawTextLayout *uiDrawNewTextLayout(uiAttributedString *s, uiDrawFontDescriptor *defaultFont, double width);
|
_UI_EXTERN uiDrawTextLayout *uiDrawNewTextLayout(uiDrawTextLayoutParams *params);
|
||||||
_UI_EXTERN void uiDrawFreeTextLayout(uiDrawTextLayout *tl);
|
_UI_EXTERN void uiDrawFreeTextLayout(uiDrawTextLayout *tl);
|
||||||
_UI_EXTERN void uiDrawText(uiDrawContext *c, uiDrawTextLayout *tl, double x, double y);
|
_UI_EXTERN void uiDrawText(uiDrawContext *c, uiDrawTextLayout *tl, double x, double y);
|
||||||
_UI_EXTERN void uiDrawTextLayoutExtents(uiDrawTextLayout *tl, double *width, double *height);
|
_UI_EXTERN void uiDrawTextLayoutExtents(uiDrawTextLayout *tl, double *width, double *height);
|
||||||
|
|
Loading…
Reference in New Issue