I do not use subsetting. But I tried to use it too, while trying to solve the problem, without success.
Below an original code written in FoxPro I use in my program to render the text into PDF. If you have any questions about the code - please do not hesitate to ask me
LPARAMETERS tcText, tnTop, tnLeft, tnHeight, tnWidth, tcFontName, tlFontBold, tlFontItalic, ;
tlFontUnderline, tlFontStrikethru, tnFontSize, tnAlignment, tlTransparent, tnForeColor, ;
tnFillColor, tcHyperLink, tcTitleOfFormField, tnTypeOfFormField, tcDataType,;
tcReportObjectName, tcPFXFileName, tcPFXFilePassword, tcSignatureImageFileName
LOCAL lcFontName
LOCAL lcOldExact
LOCAL lcTitleOfFormField
LOCAL lcSeparator
LOCAL lcCentury
LOCAL lcDateFormat
LOCAL lcYearFormat
LOCAL lcDateFormatForScript
LOCAL lnElementNumber
LOCAL lnRow
LOCAL lnFontID
LOCAL lnFormFontID
LOCAL lnForeColor
LOCAL lnFillColor
LOCAL lnRed
LOCAL lnGreen
LOCAL lnBlue
LOCAL lnFillRed
LOCAL lnFillGreen
LOCAL lnFillBlue
LOCAL lnFieldIndex
LOCAL lnMultiline
LOCAL lnPassword
LOCAL lnFileSelect
LOCAL lnDoNotSpellCheck
LOCAL lnDoNotScroll
LOCAL lnElementNumber
LOCAL lnSignatureType
LOCAL lnDecimals
LOCAL lnPosSeparator
LOCAL lnSeparator
WITH THIS
IF !EMPTY(.cUnicodeRanges) AND !EMPTY(tcDataType) AND tcDataType = 'C'
tcText = .ReverseString(tcText)
ENDIF
*-- Add, if needed it, Field's value to Report Content Table
IF !EMPTY(tcReportObjectName)
*-- If tcReportObjectName is - called from Listener
lnElementNumber = ASCAN(.aContentsField, tcReportObjectName)
IF lnElementNumber > 0 AND;
(!EMPTY(tcText) OR .lPrintEmptyField)
APPEND BLANK IN (.cReportContentTable)
REPLACE nPage WITH .nCurrentPage,;
cReportObjectName WITH tcReportObjectName,;
nTop WITH tnTop,;
mSource WITH RTRIM(tcText);
IN (.cReportContentTable)
ENDIF
ENDIF
lcFontName = PROPER(tcFontName)
DO CASE
CASE lcFontName = 'Micre13b Match'
OTHERWISE
IF tlFontBold
lcFontName = lcFontName + ' ' + .TranslateFontStyle('Bold')
ENDIF
IF tlFontItalic
lcFontName = lcFontName + ' ' + .TranslateFontStyle('Italic')
ENDIF
ENDCASE
*-- If I use CodePage the text in the Form Fields are nor displayed.
*-- Looks like it except only ANSI
IF EMPTY(tcTitleOfFormField)
lcFontName = lcFontName + ' {' + ALLTRIM(STR(.nCodePage)) + '} '
ENDIF
lcOldExact = SET('EXACT')
SET EXACT ON
lnElementNumber = ASCAN(.aUsedFonts, lcFontName)
SET EXACT &lcOldExact
IF lnElementNumber > 0
lnRow = ASUBSCRIPT(.aUsedFonts, lnElementNumber, 1)
lnFontID = .aUsedFonts(lnRow, 2)
ELSE
IF !EMPTY(.aUsedFonts(1, 1))
DIMENSION .aUsedFonts(ALEN(.aUsedFonts, 1) + 1, 2)
ENDIF
DO CASE
CASE 'COURIER' $ UPPER(lcFontName) AND .nCodePage = 1252
DO CASE
CASE 'BOLD' $ UPPER(lcFontName) AND 'ITALIC' $ UPPER(lcFontName)
lnFontID = DPLAddStandardFont(.nInstanceID, 2)
CASE 'BOLD' $ UPPER(lcFontName)
lnFontID = DPLAddStandardFont(.nInstanceID, 1)
CASE 'ITALIC' $ UPPER(lcFontName)
lnFontID = DPLAddStandardFont(.nInstanceID, 3)
OTHERWISE
lnFontID = DPLAddStandardFont(.nInstanceID, 0)
ENDCASE
OTHERWISE
lnFontID = DPLAddTrueTypeFont(.nInstanceID, lcFontName, IIF(.lIncludefont, 1, 0))
ENDCASE
.aUsedFonts(ALEN(.aUsedFonts, 1), 1) = lcFontName
.aUsedFonts(ALEN(.aUsedFonts, 1), 2) = lnFontID
ENDIF
IF .lReplaceSpaceChar
tcText = STRTRAN(tcText, ' ', CHR(160))
ENDIF
lnResult = DPLSelectFont(.nInstanceID, lnFontID)
lnForeColor = IIF(tnForeColor < 0, 0, tnForeColor)
.SplitColorToRGB(lnForeColor, @lnRed, @lnGreen, @lnBlue)
lnResult = DPLSetTextColor(.nInstanceID, lnRed, lnGreen, lnBlue)
lnResult = DPLSetTextAlign(.nInstanceID, tnAlignment)
lnResult = DPLSetTextSize(.nInstanceID, tnFontSize)
DO CASE
CASE tlFontStrikethru
lnResult = DPLSetTextUnderline(.nInstanceID, 3)
lnResult = DPLSetTextUnderlineColor(.nInstanceID, lnRed, lnGreen, lnBlue)
CASE tlFontUnderline
lnResult = DPLSetTextUnderline(.nInstanceID, 1)
lnResult = DPLSetTextUnderlineColor(.nInstanceID, lnRed, lnGreen, lnBlue)
OTHERWISE
lnResult = DPLSetTextUnderline(.nInstanceID, 0)
ENDCASE
IF !tlTransparent
lnFillColor = IIF(tnFillColor < 0 , RGB(255, 255, 255), tnFillColor)
.SplitColorToRGB(lnFillColor, @lnFillRed, @lnFillGreen, @lnFillBlue)
lnResult = DPLSetFillColor(.nInstanceID, lnFillRed, lnFillGreen, lnFillBlue)
lnResult = DPLDrawBox(.nInstanceID, tnLeft, tnTop, tnWidth, tnHeight, 1)
ENDIF
IF 'CODE 128' $ UPPER(lcFontName)
tcText = STRTRAN(tcText, CHR(160), ' ')
ENDIF
DO CASE
CASE !EMPTY(tcTitleOfFormField) AND INLIST(tnTypeOfFormField, 1, 6)
lnElementNumber = ASCAN(.aUsedFormFonts, lnFontID)
IF lnElementNumber > 0
lnRow = ASUBSCRIPT(.aUsedFormFonts, lnElementNumber, 1)
lnFormFontID = .aUsedFormFonts(lnRow, 2)
ELSE
lnFormFontID = DPLAddFormFont(.nInstanceID, lnFontID)
IF !EMPTY(.aUsedFormFonts(1, 1))
DIMENSION .aUsedFormFonts(ALEN(.aUsedFormFonts, 1) + 1, 2)
ENDIF
.aUsedFormFonts(ALEN(.aUsedFormFonts, 1), 1) = lnFontID
.aUsedFormFonts(ALEN(.aUsedFormFonts, 1), 2) = lnFormFontID
ENDIF
lcTitleOfFormField = EVALUATE(tcTitleOfFormField)
DO CASE
CASE tnTypeOfFormField = 6
DO CASE
CASE SEEK(lcTitleOfFormField, .cSignFildsList, 'FieldTitle')
OTHERWISE
DO CASE
CASE !EMPTY(tcPFXFileName) AND !EMPTY(tcPFXFilePassword)
lnSignatureType = 1
tcPFXFileName = ;
IIF(!EMPTY(tcPFXFileName), EVALUATE(tcPFXFileName), '')
tcSignatureImageFileName = ;
IIF(!EMPTY(tcSignatureImageFileName), EVALUATE(tcSignatureImageFileName),'')
OTHERWISE
lnSignatureType = 0
lnFieldIndex = ;
DPLNewFormField(.nInstanceID, lcTitleOfFormField, tnTypeOfFormField)
lnResult = ;
DPLSetFormFieldBounds(.nInstanceID, lnFieldIndex, tnLeft, tnTop, tnWidth, tnHeight)
ENDCASE
APPEND BLANK IN (.cSignFildsList)
REPLACE ;
cTitleOfFormField WITH lcTitleOfFormField,;
cPFXFileName WITH tcPFXFileName,;
cPFXFilePassword WITH tcPFXFilePassword,;
cSignatureImageFileName WITH tcSignatureImageFileName,;
cReason WITH '',;
cLocation WITH '',;
cContactInfo WITH '',;
nPage WITH IIF(EMPTY(tcReportObjectName),.nPage,.nCurrentPage),;
nTop WITH tnTop,;
nLeft WITH tnLeft,;
nWidth WITH tnWidth,;
nHeight WITH tnHeight,;
nSignatureType WITH lnSignatureType;
IN (.cSignFildsList)
ENDCASE
OTHERWISE
lnFieldIndex = DPLNewFormField(.nInstanceID, lcTitleOfFormField, tnTypeOfFormField)
lnResult = DPLSetFormFieldBounds(.nInstanceID, lnFieldIndex, tnLeft, tnTop, tnWidth, tnHeight)
lnResult = DPLSetFormFieldValue(.nInstanceID, lnFieldIndex, tcText)
lnResult = DPLSetFormFieldAlignment(.nInstanceID, lnFieldIndex, tnAlignment)
lnMultiline = 1
lnPassword = 0
lnFileSelect = 0
lnDoNotSpellCheck = 1
lnDoNotScroll = IIF(tcDataType = 'C', 0, 1)
lnResult = DPLSetFormFieldTextFlags(.nInstanceID, ;
lnFieldIndex, ;
lnMultiline, ;
lnPassword, ;
lnFileSelect, ;
lnDoNotSpellCheck, ;
lnDoNotScroll)
*-- Sets the font that the specified form field must use.
lnResult = DPLSetFormFieldFont(.nInstanceID, ;
lnFieldIndex, ;
lnFormFontID)
*-- Sets the color of the text in the form field.
lnResult = DPLSetFormFieldColor(.nInstanceID, ;
lnFieldIndex, ;
lnRed, ;
lnGreen, ;
lnBlue)
*-- Sets the background color of the specified form field.
IF !tlTransparent
lnResult = DPLSetFormFieldBackgroundColor(.nInstanceID, ;
lnFieldIndex, ;
lnFillRed, ;
lnFillGreen, ;
lnFillBlue)
ENDIF
*-- Sets the size of the text in the specified form field. A value of 0 indicates that the form field
*-- autosizes the text to fit into the available space.
lnResult = DPLSetFormFieldTextSize(.nInstanceID, ;
lnFieldIndex, IIF(.lAutosizeFormFieldText, 0, tnFontSize))
DO CASE
CASE tcDataType = 'N'
*-- Deterine number of decimals and decimal separater
lcSeparator = SET('POINT')
lnPosSeparator = RAT(lcSeparator, tcText)
lnDecimals = IIF(lnPosSeparator = 0, 0, LEN(tcText) - lnPosSeparator)
lnSeparator = IIF(lcSeparator = '.', 1, 3)
lnResult = DPLFormFieldJavaScriptAction(.nInstanceID, ;
lnFieldIndex, 'K', [AFNumber_Keystroke(]+TRANSFORM(lnDecimals)+[,]+TRANSFORM(lnSeparator)+[,0,0,'',true)])
lnResult = DPLFormFieldJavaScriptAction(.nInstanceID, ;
lnFieldIndex, 'F', [AFNumber_Format(]+TRANSFORM(lnDecimals)+[,]+TRANSFORM(lnSeparator)+[,0,0,'',true)])
CASE tcDataType = 'D'
lcCentury = SET('CENTURY')
lcDateFormat = SET('DATE')
lcYearFormat = IIF(lcCentury = 'ON', 'yyyy', 'yy')
DO CASE
CASE INLIST(lcDateFormat, 'AMERICAN', 'MDY')
lcDateFormatForScript = 'mm/dd/' + lcYearFormat
CASE lcDateFormat = 'ANSI'
lcDateFormatForScript = lcYearFormat + '.mm.dd'
CASE INLIST(lcDateFormat, 'BRITISH/FRENCH', 'DMY')
lcDateFormatForScript = 'dd/mm/' + lcYearFormat
CASE lcDateFormat = 'GERMAN'
lcDateFormatForScript = 'dd.mm.' + lcYearFormat
CASE lcDateFormat = 'ITALIAN'
lcDateFormatForScript = 'dd-mm-' + lcYearFormat
CASE INLIST(lcDateFormat, 'JAPAN', 'YMD')
lcDateFormatForScript = lcYearFormat + '/mm/dd'
CASE lcDateFormat = 'TAIWAN'
lcDateFormatForScript = lcYearFormat + '/mm/dd'
CASE lcDateFormat = 'USA'
lcDateFormatForScript = 'mm-dd-' + lcYearFormat
OTHERWISE
lcDateFormatForScript = 'dd/mm/' + lcYearFormat
ENDCASE
lnResult = DPLFormFieldJavaScriptAction(.nInstanceID, ;
lnFieldIndex, 'K', [AFDate_KeystrokeEx('] + lcDateFormatForScript + [')])
lnResult = DPLFormFieldJavaScriptAction(.nInstanceID, ;
lnFieldIndex, 'F', [AFDate_FormatEx('] + lcDateFormatForScript + [')])
ENDCASE
ENDCASE
*-- Form field cannot have HyperLink
OTHERWISE
IF .lFitTextbox
lnResult = DPLFitTextBox(.nInstanceID, tnLeft, tnTop, tnWidth, tnHeight, tcText, 1)
ELSE
lnResult = DPLDrawTextBox(.nInstanceID, tnLeft, tnTop, tnWidth, tnHeight, tcText, 4)
ENDIF
*-- Add HyperLink
IF !EMPTY(tcHyperLink)
lnResult = DPLAddLinkToWeb(.nInstanceID, tnLeft, tnTop, tnWidth, tnHeight, EVALUATE(tcHyperLink), 0)
ENDIF
ENDCASE
ENDWITH