any examples? Using DynaPDFMBS to load font on linux webserver

  1. 6 months ago

    James N

    21 May 2019 Pre-Release Testers, Xojo Pro Christchurch New Zealand
    Edited 6 months ago

    Hi Christian and other DynaPDFMBS experts.
    Ive gotten my pdf making working well on the Mac web app.
    Of course loading it to the LINUX server I encounter font issues.

    I've found a couple of commands (below) but I'm a bit lost on how to use them.

    Is there an examples somewhere to help?

    if TargetLinux then
      call pdf.AddFontSearchPath "/fonts", true
      call pdf.LoadFontEx("/fonts", 1, 10, true)
    else
      // on Mac and Windows we use system fonts.
    end if

    A big thanks up front.
    Cheers
    James

  2. Olivier C

    21 May 2019 Pre-Release Testers, Xojo Pro Europe (Belgium, France)
    Edited 6 months ago

    Hi James,

    The font path is probably different, depending on your linux flavour.
    Mine is /usr/share/fonts/msttcorefonts on a Linux server hosted by serverwarp.

    if  TargetLinux then
      Call pdf.AddFontSearchPath ("/usr/share/fonts/msttcorefonts", True)

    But, of course, fonts must be installed on the server. Are they ?

  3. Christian S

    21 May 2019 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    I've not seen a Linux with fonts in a /fonts folder. Where did you get that?

  4. James N

    22 May 2019 Pre-Release Testers, Xojo Pro Christchurch New Zealand

    Hi Christian
    I tried to use a build folder under the CGI folder called fonts where I put my own fonts, and then try and direct it from there. Maybe the path should have been.. "../fonts". Maybe a bit naive..
    But Ill try Oliver's path

  5. James N

    22 May 2019 Pre-Release Testers, Xojo Pro Christchurch New Zealand
    Edited 6 months ago

    Hi Oliver
    [edited: No I havent]
    unless there are some system fonts I dont know.

  6. Tim P

    22 May 2019 Pre-Release Testers Rochester, NY

    @James N-Plank Hi Christian
    I tried to use a build folder under the CGI folder called fonts where I put my own fonts, and then try and direct it from there. Maybe the path should have been.. "../fonts". Maybe a bit naive..
    But Ill try Oliver's path

    If you use a CopyFiles step the right way, you can use SpecialFolder.Resources.

  7. James N

    22 May 2019 Pre-Release Testers, Xojo Pro Christchurch New Zealand

    Hi Tim
    never played with resources folder path before.

    How do I load files to Resource Folder using the copyFiles ?.
    I used CopyFiles to upload the Fonts folder and fonts. It's a drag and drop thing, so not sure how I ask files to go to a specific place?
    Excuse my ignorance in this area.
    Thanks

  8. Christian S

    22 May 2019 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    If you use the standard PDF fonts, you won't need a PDF fonts folder.

    see
    https://www.mbsplugins.de/archive/2015-01-29/PDF_Standard_Fonts

  9. James N

    22 May 2019 Pre-Release Testers, Xojo Pro Christchurch New Zealand

    Brilliant

    Thanks Christian

  10. Tim P

    22 May 2019 Pre-Release Testers Rochester, NY

    @James N-Plank I used CopyFiles to upload the Fonts folder and fonts. It's a drag and drop thing, so not sure how I ask files to go to a specific place?

    With the CopyFiles step selected in the navigator, the inspector offers you a few settings one of them is "Destination". Select "Resources Folder" as the destination, and the items in the copy files step are accessible with SpecialFolder.Resources (if you have a newer Xojo - if you have an older one you can use TPSF)

  11. Christian S

    22 May 2019 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    We usually also install msttcorefonts package and than point to the folder with all those fonts.
    So we can use names like Arial and Verdana.

  12. James N

    22 May 2019 Pre-Release Testers, Xojo Pro Christchurch New Zealand

    If Phillip installs these by default that's very useful. However your standard PDF fonts will definitely do the trick.

    TIM
    Thanks for that. Didn't realise that.This will be very useful in the future.
    Cheers James

or Sign Up to reply!