Announcement

Collapse
No announcement yet.

libharu - How to show extended characters in PDF with embedded fonts?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • libharu - How to show extended characters in PDF with embedded fonts?

    I am using libharu (with Jose's PB headers) in a PowerBASIC program, and am embedding two TrueType fonts into my PDF documents (Arial Bold and Times New Roman). I need to embed the fonts to be compatible with a publisher that uses the PDF file.

    i.e.

    pv=HPDF_LoadTTFontFromFile (pdf, font_path$+"Arialbd.ttf",%HPDF_TRUE)


    This works fine, except a few extended characters are not coming out right in the PDF. Specifically the 1/4 symbol (¼), the 1/2 symbol (½), the 3/4 symbol (¾), and the degree symbol (°). All four of these symbols are present in the Arial-Bold and TimesNewRoman fonts I am embedding, but they appear as square blocks or other characters in the final PDF document.

    How can I display those characters using an embedded font?

    Thanks,

    Anthony
    Anthony Watson, Mountain Software
    www.mountainsoftware.com

  • #2
    After reading through some messages on Jose's forum, I answered my own question...

    I needed to set the proper font encoding in the last field of the HPDF_GetFont call:

    fnt=HPDF_GetFont(pdf,@pdf_text,"ISO8859-13")

    Works perfectly now.

    Anthony
    Anthony Watson, Mountain Software
    www.mountainsoftware.com

    Comment


    • #3
      Thank you, Anthony!

      I'm just starting to work with LibHaru and was having a problem with not being able to get the degree character to show up on the PDF page (I'm converting from ISED QuickPDF). You have given me hope again. I'll check it out.

      Thanks!
      Jerry

      Comment


      • #4
        I just wanted to confirm that it DID fix the problem! Thank you again!

        Jerry

        Comment

        Working...
        X