Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 11.4   11.5   12.0   12.1   12.2   12.3   12.4   12.5   13.0   13.1    Statistic    FMM    Blog  

DynaPDF.TestGlyphs

Checks whether all glyphs of the text are available in the current font.

Component Version macOS Windows Linux Server iOS SDK
DynaPDF 13.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "DynaPDF.TestGlyphs"; PDF; text )   More

Parameters

Parameter Description Example
PDF The PDF reference returned from DynaPDF.New. $pdf
text Text to be checked. "Hello World"

Result

Returns number or error.

Description

Checks whether all glyphs of the text are available in the current font.
The return value is the position of the first missing glyph, or -1 if all glyphs are available.
If the font uses a mixed 8/16 bit CJK code page that requires a conversion to Unicode (a code page that ends with "_Uni"), the return value corresponds to the converted Unicode string and not to the CJK input string.

See also TestGlyphs function in DynaPDF manual.

Examples

Test some text:

# some text with Japanese characters
Set Variable [ $text ; Value: "Tokyo 東京都 " ]
# test with Helvetica
Set Variable [ $r ; Value: MBS("DynaPDF.SetFont"; $pdf; "Helvetica"; 0; 12) ]
Set Variable [ $pos1 ; Value: MBS("DynaPDF.TestGlyphs"; $pdf; $text) ]
# test with Arial Unicode
Set Variable [ $r ; Value: MBS("DynaPDF.SetFont"; $pdf; "Arial Unicode MS"; 0; 12) ]
Set Variable [ $pos2 ; Value: MBS("DynaPDF.TestGlyphs"; $pdf; $text) ]
Show Custom Dialog [ "Position of first character not in the font:" ; $pos1 & ¶ & $pos2 ]

See also

Release notes

Blog Entries

This function checks for a paid license.

Created 27th November 2022, last changed 27th November 2022


DynaPDF.Table.SetTableWidth - DynaPDF.TextAnnot

💬 Ask a question or report a problem


Start Chat