Vuo
1.2.6
|
VuoImageText interface.
Classes | |
struct | _VuoImageTextData |
Placement info about text when rendered to an image. More... | |
Typedefs | |
typedef struct _VuoImageTextData * | VuoImageTextData |
Placement info about text when rendered to an image. | |
Functions | |
VuoImageTextData | VuoImageTextData_make () |
Initialize a new instance of VuoImageTextData. | |
void | VuoImageTextData_free (void *data) |
Free a VuoImageTextData pointer and it's contents. | |
void | VuoImageTextData_convertToVuoCoordinates (VuoImageTextData textData, VuoReal screenWidthInPixels, VuoReal backingScaleFactor) |
Convert VuoImageTextData from pixel coordinates to Vuo coordinates in place. | |
VuoPoint2d | VuoImageTextData_getPositionForCharIndex (VuoImageTextData textData, unsigned int charIndex) |
Get the starting point for a character index (bottom left corner). | |
int | VuoImageTextData_getNearestCharToPoint (VuoImageTextData textData, VuoPoint2d point) |
Return the character index nearest to point (0 indexed). | |
VuoImageTextData | VuoImage_getTextImageData (VuoText text, VuoFont font, bool includeTrailingWhiteSpace) |
Returns a struct containing all information necessary to calculate text and character size and placement when rendered. | |
VuoRectangle | VuoImage_getTextRectangle (VuoText text, VuoFont font, bool includeTrailingWhiteSpace) |
Returns a rectangle (in points) that fully encloses the specified text when rendered with the specified font . | |
VuoPoint2d | VuoImageText_getTextSize (VuoText text, VuoFont font, VuoPoint2d windowSize, VuoReal backingScaleFactor, bool includeTrailingWhiteSpace) |
Outputs the size in Vuo coordinates of a real-size text layer. | |
VuoImage | VuoImage_makeText (VuoText text, VuoFont font, float backingScaleFactor) |
Creates an image containing the specified text. | |
struct _VuoImageTextData |
Class Members | ||
---|---|---|
VuoRectangle | bounds | The bounding box of all text. |
VuoReal * | charAdvance | The x advance for each character in each line, taking kerning into account. |
unsigned int | charCount | The number of characters represented by this data. |
VuoReal | height | Bounding rect height, including padding for anti-aliasing. |
VuoHorizontalAlignment | horizontalAlignment | The horizontal alignment of this font. |
VuoRectangle * | lineBounds | Bounding rect of each line of text. |
unsigned int | lineCount | The number of lines text was split into for rendering. |
unsigned int * | lineCounts | The number of characters for each line (not including new line character - this means sum of lineCounts != characterCount). |
VuoReal | lineHeight | The line height for the font. |
VuoReal | width | Bounding rect width, including padding for anti-aliasing. This value can optionally contain the trailing white space (as specified by includeTrailingWhiteSpace). |
typedef struct _VuoImageTextData * VuoImageTextData |
Placement info about text when rendered to an image.
VuoImageTextData VuoImage_getTextImageData | ( | VuoText | text, |
VuoFont | font, | ||
bool | includeTrailingWhiteSpace | ||
) |
Returns a struct containing all information necessary to calculate text and character size and placement when rendered.
If text is null or empty, null is returned.
VuoRectangle VuoImage_getTextRectangle | ( | VuoText | text, |
VuoFont | font, | ||
bool | includeTrailingWhiteSpace | ||
) |
Returns a rectangle (in points) that fully encloses the specified text
when rendered with the specified font
.
Depending on the font's design (e.g., if the font is monospace), the rectangle may be larger than the actual glyphs.
Creates an image containing the specified text.
VuoPoint2d VuoImageText_getTextSize | ( | VuoText | text, |
VuoFont | font, | ||
VuoPoint2d | windowSize, | ||
VuoReal | backingScaleFactor, | ||
bool | includeTrailingWhiteSpace | ||
) |
Outputs the size in Vuo coordinates of a real-size text layer.
windowSize is in points.
void VuoImageTextData_convertToVuoCoordinates | ( | VuoImageTextData | textData, |
VuoReal | screenWidthInPixels, | ||
VuoReal | backingScaleFactor | ||
) |
Convert VuoImageTextData from pixel coordinates to Vuo coordinates in place.
void VuoImageTextData_free | ( | void * | data | ) |
Free a VuoImageTextData pointer and it's contents.
int VuoImageTextData_getNearestCharToPoint | ( | VuoImageTextData | textData, |
VuoPoint2d | point | ||
) |
Return the character index nearest to point (0 indexed).
VuoPoint2d VuoImageTextData_getPositionForCharIndex | ( | VuoImageTextData | textData, |
unsigned int | charIndex | ||
) |
Get the starting point for a character index (bottom left corner).
VuoImageTextData VuoImageTextData_make | ( | ) |
Initialize a new instance of VuoImageTextData.