mirror of
https://github.com/UglyToad/PdfPig.git
synced 2026-03-10 00:23:29 +08:00
Fix #514 Print Character with ZapfDingbats font
This commit is contained in:
@@ -182,9 +182,16 @@
|
||||
|
||||
private MacExpertEncoding()
|
||||
{
|
||||
foreach (var valueTuple in EncodingTable)
|
||||
foreach ((var codeToBeConverted, var name) in EncodingTable)
|
||||
{
|
||||
Add(OctalHelpers.FromOctalInt(valueTuple.Item1), valueTuple.Item2);
|
||||
// In source code an int literal with a leading zero ('0')
|
||||
// in other languages ('C' and 'Java') would be interpreted
|
||||
// as octal (base 8) and converted but C# does not support and
|
||||
// so arrives here as a different value parsed as base10.
|
||||
// Convert 'codeToBeConverted' to intended value as if it was an octal literal before using.
|
||||
// For example 040 converts to string "40" then convert string to int again but using base 8 (octal) so result is 32 (base 10).
|
||||
var code = System.Convert.ToInt32($"{codeToBeConverted}", 8); // alternative is OctalHelpers.FromOctalInt()
|
||||
Add(code, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user