Jump to content

vicmandev

Members
  • Posts

    1
  • Joined

  • Last visited

vicmandev's Achievements

Seeker

Seeker (1/7)

1

Reputation

  1. Allowing accented characters Change in MPDF_UDF.au3 v1.0.3 Func _LoadFontTT($sAlias, $BaseFont, $sOptions = $PDF_FONT_NORMAL) Local $sTemp = "" $_Font = $_Font + 1 $BaseFont = StringReplace($BaseFont, " ", "") Switch $BaseFont Case "TimesNewRoman" __FontTimes($sOptions) Case "CourierNew" __FontCourier($sOptions) Case "Symbol" __FontSymbol($sOptions) Case "Calibri" __FontCalibri($sOptions) Case "Garamond" __FontGaramond($sOptions) Case Else __FontArial($sOptions) EndSwitch Local $i = __InitObj() __ToBuffer("<< /Type/Font/Subtype/TrueType/Name/" & $sAlias & "/BaseFont/" & $BaseFont & $sOptions & "/FirstChar " & $FirstChar & "/LastChar " & $LastChar & "/FontDescriptor " & $i + 1 & " 0 R/Encoding/WinAnsiEncoding/Widths [") For $j = $FirstChar To $LastChar If $Widths[$j - $FirstChar] <> 0 Then $sTemp &= __ToStr($Widths[$j - $FirstChar]) & " " If Mod($j - $FirstChar + 1, 16) = 0 Or $j = $LastChar Then __ToBuffer($sTemp) $sTemp = "" EndIf EndIf Next __ToBuffer("] >>") __EndObj() $_sFONT = $_sFONT & "/" & $sAlias & " " & $i & " 0 R " & @CRLF $_sFONTNAME = $_sFONTNAME & "<" & $sAlias & ">" & StringRight("0000" & $_Font, 4) & ";" ;$i = __InitObj() __ToBuffer("<< /Type/FontDescriptor/FontName/" & $BaseFont & $Param & ">>") __EndObj() EndFunc ;==>_LoadFontTT To Func _LoadFontTT($sAlias, $BaseFont, $sOptions = $PDF_FONT_NORMAL) Local $sTemp = "" $_Font = $_Font + 1 $BaseFont = StringReplace($BaseFont, " ", "") Switch $BaseFont Case "TimesNewRoman" __FontTimes($sOptions) Case "CourierNew" __FontCourier($sOptions) Case "Symbol" __FontSymbol($sOptions) Case "Calibri" __FontCalibri($sOptions) Case "Garamond" __FontGaramond($sOptions) Case Else __FontArial($sOptions) EndSwitch Local $i = __InitObj() __ToBuffer("<< /Type/Font/Subtype/TrueType/Name/" & $sAlias & "/BaseFont/" & $BaseFont & $sOptions & "/FirstChar " & $FirstChar & "/LastChar " & $LastChar & "/FontDescriptor " & $i + 1 & " 0 R/Encoding/WinAnsiEncoding/Widths [") For $j = $FirstChar To $LastChar ; VMA, para que acepte cualquier caracter If $Widths[$j] <> 0 Then $sTemp &= __ToStr($Widths[$j]) & " " If Mod($j - $FirstChar + 1, 16) = 0 Or $j = $LastChar Then __ToBuffer($sTemp) $sTemp = "" EndIf EndIf #cs If $Widths[$j - $FirstChar] <> 0 Then $sTemp &= __ToStr($Widths[$j - $FirstChar]) & " " If Mod($j - $FirstChar + 1, 16) = 0 Or $j = $LastChar Then __ToBuffer($sTemp) $sTemp = "" EndIf EndIf #ce Next __ToBuffer("] >>") __EndObj() $_sFONT = $_sFONT & "/" & $sAlias & " " & $i & " 0 R " & @CRLF $_sFONTNAME = $_sFONTNAME & "<" & $sAlias & ">" & StringRight("0000" & $_Font, 4) & ";" ;$i = __InitObj() __ToBuffer("<< /Type/FontDescriptor/FontName/" & $BaseFont & $Param & ">>") __EndObj() EndFunc ;==>_LoadFontTT
×
×
  • Create New...