• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Fonts on unix server - oracle reports

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

    Fonts on unix server - oracle reports

    Where should a .ttf file go on a Solaris box so that an Oracle Reports process will pick it up?

    This sort of thing is most definitely not my bag, so I apologise if the question is badly worded.
    If you find this post offensive, please insert "Chan" before and "tho" after, then it should be OK.

    Sometimes I almost feel just like a human being - Elvis Costello

    #2
    Originally posted by Chantho View Post
    Where should a .ttf file go on a Solaris box so that an Oracle Reports process will pick it up?

    This sort of thing is most definitely not my bag, so I apologise if the question is badly worded.
    Any use? - http://developers.sun.com/dev/gadc/t...ing_fonts.html

    Looks like a hidden "fonts" folder in the home directory of the user the Oracle Reports process is running under.

    Comment


      #3
      Originally posted by NoddY View Post
      Any use? - http://developers.sun.com/dev/gadc/t...ing_fonts.html

      Looks like a hidden "fonts" folder in the home directory of the user the Oracle Reports process is running under.
      Thanks, I have since received the note below (long) which shows how easy it all can be, have yet to try it out though.

      >>>
      This note attempts to document the steps needed to install the barcode
      font provided by Logimatic on a Solaris system.

      There were many false steps along the way. Although, I believe that
      the false steps have been eliminated, please let me know if these
      steps don't work in a pristine environment.

      There may be other ways to enable barcode printing (for example, I'm
      under the impression that using a TrueType font file should work when
      using PDF:Embeding, but I had no success with that approach), but
      following these steps should result in a environment when the barcode
      font is displayed when using print preview or when printing a report
      containing a barcode.

      Using the provided barcode font (3OF9.ttf) in the Unix environment
      requires conversion from a TrueType font to a Postscript Type 1 font
      using a utility such as ttf2pt1.

      ttf2pt1 wasn't installed on the Solaris system, so I used a Ubuntu
      Linux system to do the conversion. Since ttf2pt1 wasn't already
      installed, ttf2pt1 was installed using the apt-get command:
      $ sudo apt-get -u install ttf2pt1

      The conversion was performed using the command:
      $ ttf2pt1 -e -m h=178 3OF9.ttf
      (there were some warnings emitted which were eliminated by specifying
      "-m h=178".)

      ttf2pt1 generated 3OF9.afm (the font metrics) and 3OF9.pfa (the font).

      For naming consistency (an Oracle Metalink article states that the
      filename created in the AFM directory must match the FontName), rename
      the files to match the "FontName" found in the .afm file
      (DOf9Barcode):
      $ mv 3OF9.afm DOf9Barcode.afm
      $ mv 3OF9.pfa DOf9Barcode.pfa

      (The source code for ttf2pt1 indicates that a leading digit is not allowed,
      thus the mapping of the "3" to a "D".)

      Transfer DOf9Barcode.afm and DOf9Barcode.pfa (as text files) to the
      Unix system. These files should be placed in a directory included in
      the REPORTS_PATH environmental variable (probably set in
      $ORACLE_HOME/bin/reports.sh). We'll use /mars/test in this document.

      There are two separate activities that must be performed:
      o Enable print preview
      o Enable printing

      To enable the display of barcodes using the print preview function:
      o Copy the .afm file to the $ORACLE_HOME/guicommon/tk/admin/AFM
      directory without the .afm suffix:
      $ cp /mars/test/DOf9Barcode.afm $ORACLE_HOME/guicommon/tk/admin/AFM/DOf9Barcode

      o Update the PPD file(s) that is being used to include a line that
      looks like:
      *Font DOf9Barcode: Special "(001.004)" Standard ROM
      If you aren't sure which PPD file is being used you may be able to
      $ grep PPD $ORACLE_HOME/reports/cache/*
      and look for lines that look something like:
      NOTE: This file was generated with the PPD file screenprinter.ppd.

      o Edit $ORACLE_HOME/guicommon/tk/admin/uifont.ali and add
      "3 of 9 Barcode" = "DOf9Barcode.afm DOf9Barcode.pfa"
      to the PDF:Embed section (where "3 of 9 Barcode" is obtained from
      "FullName" from the .afm file).

      Before these changes will take effect, the report server must be restarted

      At this point, a valid PostScript file should be being generated if
      "Printer" is set as the destination type. However, the file probably
      won't be printed correctly due to the lack of the barcode font being
      present on the printer.

      It is assumed that a PostScript capable printer is available. If
      Ghostscript is being used to process the PostScript file before being
      sent to a printer, further (Ghostscript) configuration steps may be
      required.

      $ORACLE_HOME/bin/rwlpr.sh is a shell script used by Oracle Reports to
      queue a file to the print subsystem. We will modify this shell script
      to prepend the DOf9Barcode.pfa file to the file generated by Oracle
      Reports before the file is queued to the printer.

      These lines should be inserted in the rwlpr.sh script after the if
      statement that prints the help text for the shell script:

      # Since we are using a font that is not present on our printers,
      # we must prepend the PostScript Type 1 font file to the beginning
      # of each file sent to the printer.

      # To prevent major changes to this shell script, we'll insert some
      # code here that modifies the file to be printed.

      # Obtain filename (which is the last argument).
      eval "tfilename=\$$#"

      # "Update" file
      mv $tfilename $tfilename.tmp
      cat /zzzz/test/DOf9Barcode.pfa $tfilename.tmp >$tfilename
      rm $tfilename.tmp

      Note that /zzzz/test must be changed to the directory where the
      DOf9Barcode.afm and DOf9Barcode.pfa files were placed. (I'd suggest
      setting an environmental variable in the environment from where the
      Oracle Reports process is started and using that environmental
      variable instead of hard coding the path in various places.)

      At this point, it should be possible to route a report to a printer.

      Good luck!




      Here's diffs of the files that were edited:

      $ diff -u $ORACLE_HOME/guicommon/tk/admin/PPD/screenprinter.ppd.org $ORACLE_HOME/guicommon/tk/admin/PPD/screenprinter.ppd
      --- /oracle/u01/product/mt1/guicommon/tk/admin/PPD/screenprinter.ppd.org Tue Apr 23 10:26:00 2002
      +++ /oracle/u01/product/mt1/guicommon/tk/admin/PPD/screenprinter.ppd Mon Jan 14 07:42:07 2008
      @@ -402,6 +402,7 @@
      *Font Times-Roman: Standard "(001.007S)" Standard ROM
      *Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
      *Font ZapfDingbats: Special "(001.004S)" Special ROM
      +*Font DOf9Barcode: Special "(001.004)" Standard ROM
      *?FontQuery: "
      save
      { count 1 gt



      $ diff -U 7 $ORACLE_HOME/guicommon/tk/admin/uifont.ali.org $ORACLE_HOME/guicommon/tk/admin/uifont.ali
      --- /oracle/u01/product/mt1/guicommon/tk/admin/uifont.ali.org Wed Nov 10 03:39:00 2004
      +++ /oracle/u01/product/mt1/guicommon/tk/admin/uifont.ali Mon Jan 14 08:15:06 2008
      @@ -246,14 +246,15 @@

      [ PDF:Embed ]

      # This example shows how to embed Type 1 helvetica font into the PDF file:
      # helvetica = "helvetica.afm helvetica.pfa"
      # You need to specify the .afm file before the .pfa file.
      # The font files must exist in one of the folders specified in REPORTS_PATH.
      +"3 of 9 Barcode" = "DOf9Barcode.afm DOf9Barcode.pfa"


      [ PDF:Subset ]

      # This example shows how to subset Arial True Type font into the PDF file:
      # helvetica = "Arial.ttf"
      # The True Type font files must exist in any one of the folders specified in







      *** The diff of rwlpr.sh also includes the changes required for printing to work with ***
      *** Solaris 10. ***


      $ diff -U 7 $ORACLE_HOME/bin/rwlpr.sh.org $ORACLE_HOME/bin/rwlpr.sh
      --- /oracle/u01/product/mt1/bin/rwlpr.sh.org Thu May 26 23:39:00 2005
      +++ /oracle/u01/product/mt1/bin/rwlpr.sh Mon Jan 14 12:36:31 2008
      @@ -146,14 +146,29 @@
      # If asked for Help, then Print the Help and exit
      if [ "$1" = "-help" ]
      then
      printhelp
      exit
      fi

      +# Since we are using a font that is not present on our printers,
      +# we must prepend the PostScript Type 1 font file to the beginning
      +# of each file sent to the printer.
      +
      +# To prevent major changes to this shell script, we'll insert some
      +# code here that modifies the file to be printed.
      +
      +# Obtain filename (which is the last argument).
      +eval "tfilename=\$$#"
      +
      +# "Update" file
      +mv $tfilename $tfilename.tmp
      +cat /mars/test/DOf9Barcode.pfa $tfilename.tmp >$tfilename
      +rm $tfilename.tmp
      +
      # Unix print commands that we will try to use for printing
      # Consider this as a kind of an array , from where we will
      # try and pick up one that exists on this system
      if [ `uname -s` = "HP-UX" ] # If OS is HP-UX
      then
      PRNCMDS="lp"
      else
      @@ -179,28 +194,28 @@
      then
      if [ `basename $PRNCMDPATH` = "lpr" ]
      then
      if [ `uname -s` = "Linux" ] # If OS is Linux
      then
      $PRNCMDPATH `echo $@ | tr -d "\""`
      else
      - if [ `uname -r` = "5.8" ] || [ `uname -r` = "5.9" ] # If Solaris Release 5.8 / 5.9
      + if [ `uname -r` = "5.8" ] || [ `uname -r` = "5.9" ] || [ `uname -r` = "5.10" ] # If Solaris Release 5.8 / 5.9 / 5.10
      then
      $PRNCMDPATH `echo $@ | tr -d "\""`
      else
      $PRNCMDPATH "$@"
      fi
      fi
      else
      # parse and Fix the command Line as Required by lp
      if [ `uname -s` = "Linux" ] # If OS is Linux
      then
      getLpCommandLine `echo $@ | tr -d "\""`
      else
      - if [ `uname -r` = "5.8" ] || [ `uname -r` = "5.9" ] # If Solaris Release 5.8 / 5.9
      + if [ `uname -r` = "5.8" ] || [ `uname -r` = "5.9" ] || [ `uname -r` = "5.10" ] # If Solaris Release 5.8 / 5.9 / 5.10
      then
      getLpCommandLine `echo $@ | tr -d "\""`
      else
      if [ `uname -s` = "HP-UX" ] # If OS is HP-UX
      then
      getLpCommandLine `echo $@ | sed 's/-#/-c/' | tr -d "\""`
      else
      <<<
      Last edited by Chantho; 8 April 2008, 15:13.
      If you find this post offensive, please insert "Chan" before and "tho" after, then it should be OK.

      Sometimes I almost feel just like a human being - Elvis Costello

      Comment


        #4
        Originally posted by Chantho View Post
        Thanks, I have since received the note below (long) which shows how easy it all can be, have yet to try it out though.

        >>>
        This note attempts to document the steps needed to install the barcode
        font provided by Logimatic on a Solaris system.

        There were many false steps along the way. Although, I believe that
        the false steps have been eliminated, please let me know if these
        steps don't work in a pristine environment.

        There may be other ways to enable barcode printing (for example, I'm
        under the impression that using a TrueType font file should work when
        using PDF:Embeding, but I had no success with that approach), but
        following these steps should result in a environment when the barcode
        font is displayed when using print preview or when printing a report
        containing a barcode.

        Using the provided barcode font (3OF9.ttf) in the Unix environment
        requires conversion from a TrueType font to a Postscript Type 1 font
        using a utility such as ttf2pt1.

        ttf2pt1 wasn't installed on the Solaris system, so I used a Ubuntu
        Linux system to do the conversion. Since ttf2pt1 wasn't already
        installed, ttf2pt1 was installed using the apt-get command:
        $ sudo apt-get -u install ttf2pt1

        The conversion was performed using the command:
        $ ttf2pt1 -e -m h=178 3OF9.ttf
        (there were some warnings emitted which were eliminated by specifying
        "-m h=178".)

        ttf2pt1 generated 3OF9.afm (the font metrics) and 3OF9.pfa (the font).

        For naming consistency (an Oracle Metalink article states that the
        filename created in the AFM directory must match the FontName), rename
        the files to match the "FontName" found in the .afm file
        (DOf9Barcode):
        $ mv 3OF9.afm DOf9Barcode.afm
        $ mv 3OF9.pfa DOf9Barcode.pfa

        (The source code for ttf2pt1 indicates that a leading digit is not allowed,
        thus the mapping of the "3" to a "D".)

        Transfer DOf9Barcode.afm and DOf9Barcode.pfa (as text files) to the
        Unix system. These files should be placed in a directory included in
        the REPORTS_PATH environmental variable (probably set in
        $ORACLE_HOME/bin/reports.sh). We'll use /mars/test in this document.

        There are two separate activities that must be performed:
        o Enable print preview
        o Enable printing

        To enable the display of barcodes using the print preview function:
        o Copy the .afm file to the $ORACLE_HOME/guicommon/tk/admin/AFM
        directory without the .afm suffix:
        $ cp /mars/test/DOf9Barcode.afm $ORACLE_HOME/guicommon/tk/admin/AFM/DOf9Barcode

        o Update the PPD file(s) that is being used to include a line that
        looks like:
        *Font DOf9Barcode: Special "(001.004)" Standard ROM
        If you aren't sure which PPD file is being used you may be able to
        $ grep PPD $ORACLE_HOME/reports/cache/*
        and look for lines that look something like:
        NOTE: This file was generated with the PPD file screenprinter.ppd.

        o Edit $ORACLE_HOME/guicommon/tk/admin/uifont.ali and add
        "3 of 9 Barcode" = "DOf9Barcode.afm DOf9Barcode.pfa"
        to the PDF:Embed section (where "3 of 9 Barcode" is obtained from
        "FullName" from the .afm file).

        Before these changes will take effect, the report server must be restarted

        At this point, a valid PostScript file should be being generated if
        "Printer" is set as the destination type. However, the file probably
        won't be printed correctly due to the lack of the barcode font being
        present on the printer.

        It is assumed that a PostScript capable printer is available. If
        Ghostscript is being used to process the PostScript file before being
        sent to a printer, further (Ghostscript) configuration steps may be
        required.

        $ORACLE_HOME/bin/rwlpr.sh is a shell script used by Oracle Reports to
        queue a file to the print subsystem. We will modify this shell script
        to prepend the DOf9Barcode.pfa file to the file generated by Oracle
        Reports before the file is queued to the printer.

        These lines should be inserted in the rwlpr.sh script after the if
        statement that prints the help text for the shell script:

        # Since we are using a font that is not present on our printers,
        # we must prepend the PostScript Type 1 font file to the beginning
        # of each file sent to the printer.

        # To prevent major changes to this shell script, we'll insert some
        # code here that modifies the file to be printed.

        # Obtain filename (which is the last argument).
        eval "tfilename=\$$#"

        # "Update" file
        mv $tfilename $tfilename.tmp
        cat /mars/test/DOf9Barcode.pfa $tfilename.tmp >$tfilename
        rm $tfilename.tmp

        Note that /mars/test must be changed to the directory where the
        DOf9Barcode.afm and DOf9Barcode.pfa files were placed. (I'd suggest
        setting an environmental variable in the environment from where the
        Oracle Reports process is started and using that environmental
        variable instead of hard coding the path in various places.)

        At this point, it should be possible to route a report to a printer.

        Good luck!




        Here's diffs of the files that were edited:

        $ diff -u $ORACLE_HOME/guicommon/tk/admin/PPD/screenprinter.ppd.org $ORACLE_HOME/guicommon/tk/admin/PPD/screenprinter.ppd
        --- /oracle/u01/product/mt1/guicommon/tk/admin/PPD/screenprinter.ppd.org Tue Apr 23 10:26:00 2002
        +++ /oracle/u01/product/mt1/guicommon/tk/admin/PPD/screenprinter.ppd Mon Jan 14 07:42:07 2008
        @@ -402,6 +402,7 @@
        *Font Times-Roman: Standard "(001.007S)" Standard ROM
        *Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
        *Font ZapfDingbats: Special "(001.004S)" Special ROM
        +*Font DOf9Barcode: Special "(001.004)" Standard ROM
        *?FontQuery: "
        save
        { count 1 gt



        $ diff -U 7 $ORACLE_HOME/guicommon/tk/admin/uifont.ali.org $ORACLE_HOME/guicommon/tk/admin/uifont.ali
        --- /oracle/u01/product/mt1/guicommon/tk/admin/uifont.ali.org Wed Nov 10 03:39:00 2004
        +++ /oracle/u01/product/mt1/guicommon/tk/admin/uifont.ali Mon Jan 14 08:15:06 2008
        @@ -246,14 +246,15 @@

        [ PDF:Embed ]

        # This example shows how to embed Type 1 helvetica font into the PDF file:
        # helvetica = "helvetica.afm helvetica.pfa"
        # You need to specify the .afm file before the .pfa file.
        # The font files must exist in one of the folders specified in REPORTS_PATH.
        +"3 of 9 Barcode" = "DOf9Barcode.afm DOf9Barcode.pfa"


        [ PDF:Subset ]

        # This example shows how to subset Arial True Type font into the PDF file:
        # helvetica = "Arial.ttf"
        # The True Type font files must exist in any one of the folders specified in







        *** The diff of rwlpr.sh also includes the changes required for printing to work with ***
        *** Solaris 10. ***


        $ diff -U 7 $ORACLE_HOME/bin/rwlpr.sh.org $ORACLE_HOME/bin/rwlpr.sh
        --- /oracle/u01/product/mt1/bin/rwlpr.sh.org Thu May 26 23:39:00 2005
        +++ /oracle/u01/product/mt1/bin/rwlpr.sh Mon Jan 14 12:36:31 2008
        @@ -146,14 +146,29 @@
        # If asked for Help, then Print the Help and exit
        if [ "$1" = "-help" ]
        then
        printhelp
        exit
        fi

        +# Since we are using a font that is not present on our printers,
        +# we must prepend the PostScript Type 1 font file to the beginning
        +# of each file sent to the printer.
        +
        +# To prevent major changes to this shell script, we'll insert some
        +# code here that modifies the file to be printed.
        +
        +# Obtain filename (which is the last argument).
        +eval "tfilename=\$$#"
        +
        +# "Update" file
        +mv $tfilename $tfilename.tmp
        +cat /mars/test/DOf9Barcode.pfa $tfilename.tmp >$tfilename
        +rm $tfilename.tmp
        +
        # Unix print commands that we will try to use for printing
        # Consider this as a kind of an array , from where we will
        # try and pick up one that exists on this system
        if [ `uname -s` = "HP-UX" ] # If OS is HP-UX
        then
        PRNCMDS="lp"
        else
        @@ -179,28 +194,28 @@
        then
        if [ `basename $PRNCMDPATH` = "lpr" ]
        then
        if [ `uname -s` = "Linux" ] # If OS is Linux
        then
        $PRNCMDPATH `echo $@ | tr -d "\""`
        else
        - if [ `uname -r` = "5.8" ] || [ `uname -r` = "5.9" ] # If Solaris Release 5.8 / 5.9
        + if [ `uname -r` = "5.8" ] || [ `uname -r` = "5.9" ] || [ `uname -r` = "5.10" ] # If Solaris Release 5.8 / 5.9 / 5.10
        then
        $PRNCMDPATH `echo $@ | tr -d "\""`
        else
        $PRNCMDPATH "$@"
        fi
        fi
        else
        # parse and Fix the command Line as Required by lp
        if [ `uname -s` = "Linux" ] # If OS is Linux
        then
        getLpCommandLine `echo $@ | tr -d "\""`
        else
        - if [ `uname -r` = "5.8" ] || [ `uname -r` = "5.9" ] # If Solaris Release 5.8 / 5.9
        + if [ `uname -r` = "5.8" ] || [ `uname -r` = "5.9" ] || [ `uname -r` = "5.10" ] # If Solaris Release 5.8 / 5.9 / 5.10
        then
        getLpCommandLine `echo $@ | tr -d "\""`
        else
        if [ `uname -s` = "HP-UX" ] # If OS is HP-UX
        then
        getLpCommandLine `echo $@ | sed 's/-#/-c/' | tr -d "\""`
        else
        <<<

        Bloody hell, that's nearly as long as one of Denny's posts
        ǝןqqıʍ

        Comment


          #5
          Originally posted by DiscoStu View Post
          Bloody hell, that's nearly as long as one of Denny's posts
          Ah, but this one is useful

          Comment


            #6
            And more interesting.
            Down with racism. Long live miscegenation!

            Comment

            Working...
            X