Am 19.03.2019 um 19:45 schrieb Christopher Schultz:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Tilman,
So I'm starting to look toward making my code better now that it's
actually working. Right now, my code looks like this:
if(!isAnsiEncoding(strippedText)) {
font = getFullUnicodeFont();
}
Where one font simply replaces the other for strings that aren't
available the the built-in font(s).
I'd like to support emoji and stuff like that. I can find a font (or
fonts) for that, but I think the only way I can do that with the
existing API is something like this:
Font[] fonts = new Font[] { builtIn, arialUnicode, emoji };
for(Font font : fonts) {
try {
page.setFont(font);
page.showText(text);
} catch (IllegalArgumentException iae) {
// Try the next font
}
}
That will "work" but it will not work if, for example, I need to print
text that includes both Chinese characters (from arialUnicode font)
and also emoji (from the hypothetical "emoji" font).
If there any way to tell PDFBox to "pick the right font (from some
list) for each character"?
No, that is why I created the EmbeddedMultipleFonts.java example which I
mentioned earlier in the thread. That one can switch within strings.
Tilman
- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlyRONIACgkQHPApP6U8
pFhu3A//dObTICq7o17gNERfJKQg6dL4nFt8eHXTrw/NZkrSzMtiyYttil+o8a5o
y3bPDQ+Nvo2FofQBFCfq480mZh1Vo8MpVNKTitUISR/14zzNPSTNa+K08bfMMYhA
8El2EgGAv/v/xtn7xFLNowOjbq7r3Hap1wmYpwLVM1aqFYL4wS6QNwlkmIsOqocs
JeeQ247g/KZHm4nJ9Z+b5Dd8vS/DpoOUzs9Yyt9APNHPRAjirevq37ALf46gowDj
GHlIGLzjNDLDLUn6sCFES2SSScHt8und/RW6K5cEJsFmtc22cFZ9RpcpeRg4BkJh
/VPDs8Iq1KzMUXWjlJTq5bWsbE8IMCtgSkYZt0Fl9FJOGrg9aIa6SjEHxZ3KsBht
RHquj3vblGYrrn22t+G+oelIm94iiWfwsIf/wmOke2fcv83lEX5xVMtTKLB+uCQo
4wwMqgkuTQiMS8KH5BlR5WCMrmGhRq4fD3gZ1Sdt4TJXiKJuUOss5sQTdDgLIyvT
jL29R79pCdnp1v90rxM2sFR3CPr/fjUZOcF1+vYKhXwyaYSFboaxCUwtFNoA+aLc
mztEIRurYq6MParoIrELyGaqVnmOD/ElcPiRdbNSWkfa8xRcAjHqeFCjZe6qrTOD
nkbAzhOG4Ty0hyI/v0zaaGvJ1lS40zzaCp0hHxDcd1td3JnUzs4=
=paYu
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org