Post without Account — your post will be reviewed, and if appropriate, posted under Anonymous. You can also use this link to report any problems registering or logging in.

CTS 26 -- observation(s): fonts will be the death of me

  • 2 Replies
  • 6 Views
*

Offline Phil

  • Global Moderator
  • Hero Member
  • *****
  • 633
    • View Profile
from: westmj

I try, I do. I figured DejaVu ttf font would solve my problems. I thought studying the documentation would solve my problems. But getting data from .xlsx or text-input, I can't make heads or tails of getting searchable text... but it seems like defaults should give that. And, why oh why, does copying "some" put "VRPH" in my paste buffer. Just kill me now.

By the way, I got your latest PDF::Table installed, so am migrating away from PDF::API2 to Builder. Thanks for all your hard work. Sorry to be such a newbie, please excuse my newbie ignorance.

Reply:

I know that TTF text was unsearchable in 3.016 and 3.017. Sorry about that. The fix is in 3.018, which will be released this month. If you want, you can compare lib/PDF/Builder/Resource/CIDFont.pm on GitHub and make the changes to your copy. See if it also fixes the odd buffer copy too. I can't run your example without installing several additional packages, which I'm hoping to avoid doing. If updating your CIDFont.pm doesn't help, I'll go ahead and install them to try to replicate the buffer problem.

I was thinking about contacting you in regards to the 010_fonts.pl PR that you submitted to PDF::Table, and Desislav pulled in to the master copy yesterday. What exactly are you trying to demonstrate with that program, now knowing that corefonts can't support UTF-8 encoding? Is it still useful for other purposes?

*

Offline Phil

  • Global Moderator
  • Hero Member
  • *****
  • 633
    • View Profile
westmj

I can likely write the example with a minimum of "use xxx;" if helpful. But hearing you are aware, and help is already in the pipeline, is VERY encouraging. I likely can wait, however, does github already incorporate the proposed fixes? I think I am getting better with github, might try upgrade to latest GitHub rather than cpan. Thanks much for your help.

Mike West <mwjwest@gmail.com>

Phone & WhatsApp: +1-302-559-3642
Address: Casa Alquimía
350 m SUR y 80 m ESTE
    de la Gasolinera Monteverde
Monteverde, Puntarenas, Costa Rica  60109
www.facebook.com/mwjwest mwjwest.wordpress.com

Phil

Yes, the changes to CIDFont.pm are on GitHub. Click "code" and navigate to CIDFont.pm. Click "history", select the first (most recent), and you'll see the change to 3 lines. That should work OK with a 3.017 installation.

My question about 010_fonts.pl was "what is this supposed to show?". If it's to demonstrate that UTF-8 text doesn't work with corefont(), there's no point in putting that in the examples. It's now documented, and corefont() will reject that encoding anyway. If it shows something else that is useful as an example, you or I can clean it up and keep it.

westmj

Thanks, I will look into it. Likely I will try perl Makefile.pl and make , make install unless you recommend against it.

about 010_fonts.pl , part of my confusion about "use utf8;" is the effect on BOTH output to terminal, and to PDF, and the plethora of conflicting advice outside of here. Rather than more blah blah blah, I wrote code that SHOWs it. An example, yes, repetitive and redundant, but from another angle; code not words. Some go to docs to understand, some to code. Let a thousand flowers bloom. Or, what does it hurt to let a weed live in a walked garden?

Mike West <mwjwest@gmail.com>

Phone & WhatsApp: +1-302-559-3642
Address: Casa Alquimía
350 m SUR y 80 m ESTE
    de la Gasolinera Monteverde
Monteverde, Puntarenas, Costa Rica  60109
www.facebook.com/mwjwest mwjwest.wordpress.com

westmj

It worked! Thank you very much. Whatever the magic is, you got it.

I installed with

perl Makefile.PL
make
make install

perl PDF-Builder-accents.pl

The resulting PDF is searchable, and copying puts what you expect in the paste buffer.

What is the magic? For wuggles...

Phil

I'm afraid that such magic is off limits to muggles!

*

Offline MrPhil

  • Administrator
  • Newbie
  • *****
  • 1
    • View Profile
westmj

$gid? $uni? Your secrets are safe from me.

Regards,
Mike "Muggles" West

Phil

Now we will have to send out some loathsome, horrid creatures to permanently silence you! Perhaps a venom-spitting flying snake that melts your lips together? ("Wuggles"? Oh dear.)

Yeah, $gid is the Glyph ID, the font-dependent index number; $uni is the Unicode number for the character. Unicode numbers can correspond to multiple glyphs (and Glyph IDs), and not all glyphs have a Unicode number. A couple of lines had a typo where usage of the two got mixed up during some editing.

westmj

Thanks for that! I think I have a glimpse at the magic. Ok, like I said,
you can kill me now. And even close this thread. Cheers!

Mike West <mwjwest@gmail.com>

Phone & WhatsApp: +1-302-559-3642
Address: Casa Alquimía
350 m SUR y 80 m ESTE
    de la Gasolinera Monteverde
Monteverde, Puntarenas, Costa Rica  60109
www.facebook.com/mwjwest mwjwest.wordpress.com

Phil

Will close when 3.018 released later this month.