Debenu Quick PDF logo

AddSubsettedFont

Text, Fonts

Description

This function is used to embed a "subset" of a font. This means that only the font information for specified characters is embedded, reducing the size of the document. This function also allows any Unicode character to be embedded which means that characters from Chinese, Japanese, Korean and other languages can be used.

The newer AddTrueTypeSubsettedFont function provides more advanced font subsetting functionality.

Syntax

Delphi

function TDebenuPDFLibrary1511.AddSubsettedFont(FontName: WideString; 
  CharsetIndex: Integer; SubsetChars: WideString): Integer;

ActiveX

Function DebenuPDFLibrary1511.PDFLibrary::AddSubsettedFont(FontName As String,
  CharsetIndex As Long, SubsetChars As String) As Long

DLL

int DPLAddSubsettedFont(int InstanceID, wchar_t * FontName, int CharsetIndex,
  wchar_t * SubsetChars)

Parameters

FontName The name of the TrueType font to install. This can either be the name of the font as shown in the Windows\Fonts folder (for example "Times New Roman Bold") or it can be the font family name with an optional style specifier in square brackets (for example "Times New Roman [BoldItalic]"). Possible optional specifiers are: [Bold], [Italic] or [BoldItalic].
CharsetIndex You must specify a character set containing the characters you want to subset:
1 = ANSI
2 = Default
3 = Symbol
4 = Shift JIS
5 = Hangeul
6 = GB2312
7 = Chinese Big 5
8 = OEM
9 = Johab
10 = Hebrew
11 = Arabic
12 = Greek
13 = Turkish
14 = Vietnamese
15 = Thai
16 = East Europe
17 = Russian
18 = Mac
19 = Baltic
SubsetChars A string containing the characters you would like to subset. Repeated characters are ignored. A maximum of 255 characters can be placed in any font subset. Any Unicode character can be embedded, but you must ensure that the character is available in the specified character set.

Return values

0 The subsetted font could not be added or the CharSet parameter was out of range
Non-zero The FontID of the added font. This ID can be used with the SelectFont function to select the font.

Copyright © 2014 Debenu. All rights reserved. AboutContactBlogNewsletterSupport