
C/C++ Functions
dtxGlyphsGetBound
DT_FLOAT dtxGlyphsGetBound(DT_DTENGINE engine, DT_ID_UBYTE crop_type, DT_FLOAT x, DT_FLOAT y, DT_SLONG spacing, DT_ID_SWORD mode, DT_TM2X2 tm, const DT_ID_ULONG glyph_arr[], const DT_SLONG glyph_arr_displacement[], const DT_SLONG glyph_arr_advance[], DT_FLOAT start_advance, DT_BMP* bmp)
Short Description: Get bounding box of a straight line of glyphs
dtxCharsGetBound
DT_FLOAT dtxCharsGetBound(DT_DTENGINE engine, DT_ID_UBYTE crop_type, DT_FLOAT x, DT_FLOAT y, DT_SLONG spacing, DT_ID_SWORD mode, DT_TM2X2 tm, const DT_ID_ULONG chars_arr[], DT_BMP* bmp)
Short Description: Get bounding box of a straight line of characters
These functions retrieve the bounding box of the text string rendered by dtxCharsDoOutput and dtxGlyphsDoOutput.
Parameters
Parameter | Description |
engine
|
Handle of the previously created Standard Engine instance.
|
crop_type
|
If crop_type = 0 (DV_CROP_HMAX_VMAX_PADDED), the function calculates the bounding box based on the largest glyph width and the tallest glyph height in the font used to draw the string text (as supplied by the Typesetter). In addition, the width of the bounding box is padded to a 4-byte alignment boundary. This calculation method is very fast, but not extremely accurate.
crop_type = 1 (DV_CROP_HMAX_VMAX) is the same as crop_type = 0, but the width of the bounding box is exact (i.e. not padded to a 4-byte alignment boundary).
If crop_type = 2 (DV_CROP_HMIN_VMAX), the function calculates the bounding box based on the actual glyph widths in the string and the tallest glyph height in the font used to draw the string text (as supplied by the Typesetter). This calculation method is somewhat slower because the actual width of each glyph in the string must be retrieved, calculated and converted to pixels.
If crop_type = 3 (DV_CROP_HMAX_VMIN), the function calculates the bounding box based on the largest glyph width in the font used to draw the string text (as supplied by the Typesetter) and the actual glyph heights in the string. This calculation method is somewhat slower because the actual height of each glyph in the string must be retrieved, calculated and converted to pixels.
If crop_type = 4 (DV_CROP_HMIN_VMIN), the function calculates the bounding box based on the actual glyph widths and the actual glyph heights in the string. This calculation method is somewhat slower because the actual width and height of each glyph in the string must be retrieved, calculated and converted to pixels.
|
x
| See dtxCharsDoOutput. |
y
| See dtxCharsDoOutput. |
spacing
| See dtxCharsDoOutput. |
mode
| See dtxCharsDoOutput. |
tm
| See dtxCharsDoOutput. |
glyph_arr
| See dtxCharsDoOutput. |
chars_arr
| See dtxCharsDoOutput. |
glyph_arr_displacement
|
See dtxCharsDoOutput.
|
glyph_arr_advance
|
See dtxCharsDoOutput.
|
start_advance
|
See dtxCharsDoOutput.
|
bmp
|
A valid pointer to the structure that will receive information about the retrieved bounding box:
memory_bitmap.m — Since the function does not render the bitmap, this value will be set to DV_NULL.
memory_bitmap.l — Since the function does not render the bitmap, this value will be set to 0.
memory_bitmap.w — width of the bounding box in pixels as defined by the DT_BMP structure
memory_bitmap.h — height of the bounding box in pixels as defined by the DT_BMP structure
memory_bitmap.x — horizontal distance between the left edge of the bounding box and the origin point of the text line as defined by the DT_BMP structure, in pixels
memory_bitmap.y — vertical distance between the origin point of the text line and the top edge of the bounding box as defined by the DT_BMP structure, in pixels
|
Return Value
See dtxCharsDoOutput.
Example
-
When crop_type = 0 (DV_CROP_HMAX_VMAX_PADDED)
AdvanceWidth=284
bmp.x=-12, bmp.y=88, bmp.w=320, bmp.h=112, bmp.m=DV_NULL, bmp.l=0
-
When crop_type = 1 (DV_CROP_HMAX_VMAX)
AdvanceWidth=284
bmp.x=-12, bmp.y=88, bmp.w=317, bmp.h=112, bmp.m=DV_NULL, bmp.l=0
-
When crop_type = 2 (DV_CROP_HMIN_VMAX)
AdvanceWidth=284
bmp.x=3, bmp.y=88, bmp.w=275, bmp.h=112, bmp.m=DV_NULL, bmp.l=0
-
When crop_type = 3 (DV_CROP_HMAX_VMIN)
AdvanceWidth=284
bmp.x=-12, bmp.y=82, bmp.w=317, bmp.h=102, bmp.m=DV_NULL, bmp.l=0
-
When crop_type = 4 (DV_CROP_HMIN_VMIN)
AdvanceWidth=284
bmp.x=3, bmp.y=82, bmp.w=275, bmp.h=102, bmp.m=DV_NULL, bmp.l=0
