Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

illustrate utf8 pitfalls #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

illustrate utf8 pitfalls #20

wants to merge 1 commit into from

Conversation

westmj
Copy link

@westmj westmj commented Oct 14, 2019

corefonts do not contain many utf8 characters
e.g. accents: á é í; ES: ñ Ñ ¿; etc.
True Type fonts contain these,
BUT encoding cn be tricky.

use utf8; # is helpful in sending characters to PDF

corefonts do not contain many utf8 characters
e.g. accents: á é í; ES: ñ Ñ ¿; etc.
True Type fonts contain these,
BUT encoding cn be tricky.

use utf8; # is helpful in sending characters to PDF
@coveralls
Copy link

coveralls commented Oct 14, 2019

Coverage Status

Coverage decreased (-0.003%) to 56.839% when pulling af8809e on westmj:mwjwest03 into fcc73b1 on ssimms:master.

@PhilterPaper
Copy link

I'm not sure what you're getting at by saying "corefonts do not contain many utf8 characters". You need to understand that core fonts, no matter what the physical font file is (even .ttf), are limited to a single byte encoding. By default, this is Latin-1 (or, extended to Windows-1252). You can't specify 'utf8' as the encoding for loading corefonts -- it's limited to 224 characters at most, and text must be specified as single byte in the chosen encoding. Naturally, UTF-8 encoding (ttfont method) has a much larger space for characters. If you want to use something beyond the basic Latin-1ish set, you have to use ttfont instead of corefont. psfont suffers from the same single-byte limitation.

By the way, you're misusing the "Pull Request" system here. Such an example of code illustrating a problem should be attached to a problem ticket. PRs are for code changes that you feel should be incorporated into the product code.

@westmj
Copy link
Author

westmj commented Oct 27, 2019 via email

@PhilterPaper
Copy link

Well, anyway you now know better when to open a ticket and attach a sample program, and when a PR is appropriate.

By the way, for PDF::API2 the primary ticket system is on CPAN (RT), and if you don't have a CPAN account you can email bug-PDF-API2 [at] rt.cpan.org, with the desired subject line. To add a comment to that thread, just email bug-PDF-API2 [at] rt.cpan.org with subject line [rt.cpan.org #NNNNNN]. NNNNNN is the assigned ticket number (e.g., 130722) and note 1 space between org and #, and the [ ] around the whole subject. Nothing else. If you don't follow this format carefully, you will end up creating a new bug report! HTML and other markup does not work with RT. I'm not sure if you can attach a file when using the email interface.

I agree that the documentation in PDF::API2 is weak and haphazard; I have tried to improve upon it in PDF::Builder (a fork of API2). I look at API2 bugs primarily to find things to fix in Builder (I don't fix things in API2 -- that's handled by Steve). The bottom line seems to be that you should use TTF or OTF (ttfont) fonts if you need more than the standard Latin-1 character set. If Latin-1 or other single byte encodings are OK for you, you can use corefont or psfont if you want. Good luck!

@westmj
Copy link
Author

westmj commented Nov 4, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants