Announcement

Collapse
No announcement yet.

Smaller fonts in print files

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

  • Smaller fonts in print files

    I am creating output files with losts of numerical data,
    which are used as a documentation by the users.
    PowerBASIC is using default font (which is?), which is just too big
    and the output files are very large.
    Is there a way to change that font into size 8
    or change the font itself?
    Branko S. Bedenik



    ------------------
    http://www.fg.uni-mb.si/lak/ocean


    Structural Engineering Software OCEAN2006
    Slovenia

  • #2
    Branko, I'm not really sure what you are asking here. When you say "creating output files" are you talking aboiut regular disk files, text that are sent directly to a printer, or are you using the Windows Printing System (API-based printing), or what???

    Can you please restate your question more specifically, and even give an example of the code you are using to create these files.

    Also, which compiler are you using?

    Thanks!

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Dear Lance
      sorry if i was not clear enough.

      i'm using PB DLL compiler.

      In Finite Elements number crunching i calculate i.e. displacements of a structure,
      which has to be written in a file *.DIS on the disk.

      OPEN "test.dis" for output as #1
      for i=1 to 1000
      PRINT #1, i, disY(i), disY(i) 'it is formatted!
      next i

      An user prints this file on the printer as a document.

      Is it clear now




      ------------------
      http://www.fg.uni-mb.si/lak/ocean


      Structural Engineering Software OCEAN2006
      Slovenia

      Comment


      • #4
        In this case, the font size issue is determined by the app the User uses to print the file out, as your code is exporting ASCII only (ie, there is no printer control available from your code). If they use Word, then maybe you could write a Macro to adjust the font size.

        Personally, I'd drop that method altogether, and use API-based printing techniques to handle the printing. If you search the BBS for "StartDoc" or maybe "StartPage", you should find some examples of Windows printing where you can create a suitable font yourself.

        Alternatively, you could try a 3rd-party printing solution, such as DDOC (by Don Dickinson) www.basicguru.com or DOSPRINT/DLLPRINT (written by me!) http://www.amerimports.com/dosprint

        I hope this helps!

        ------------------
        Lance
        PowerBASIC Support
        mailto:[email protected][email protected]</A>
        Lance
        mailto:[email protected]

        Comment


        • #5

          Hi, Branko Bedenik

          I had the same problem awhile back, and I had a 190 column printout
          on a standard 8 x 10, which seemed impossible!

          To solve this problem, I purchased a font-set from:
          Elfring Soft Font's TrueType Fixed Width Font Collection http://www.elfring.com/ljfonts.htm

          I used the Profix2 Font, which printed the report perfectly
          using Ddoc by Don Dickinson!

          Hope this helps!

          Mike



          ------------------
          mwm
          mwm

          Comment


          • #6
            You don't need to buy special fonts to do printing with the Windows Printing System unless you need to use a non-standard font. For most reports, Times New or Courier is usually perfectly acceptable.

            One more thing that I should point out: converting your existing PRINT#-based code to DLLPRINT (or DOSPRINT which can be used with DOS, PB/DLL and PB/CC app's) will involve very little work.

            You'll need to add a line or two of code to change the font size at the beginning of your PRINT# code, a FORMFEED at (for example) 55 lines, and finally add a call to DOSPRINT or DLLPRINT after the print file is closed.

            For example, to use DLLPRINT with your application:

            Code:
            #COMPILE EXE
            #INCLUDE "DLLPRINT.INC"
            ...
            OPEN "test.dis" for output as #1
            ' set compressed print mode, or you can use a specific font size if required.
            PRINT #1, $dpCompressed; 
            for i=1 to 1000
              PRINT #1, i, disY(i), disY(i) 'it is formatted!
              IF i MOD 55 = 0 THEN PRINT #1, $dpFF;
            next i
            CLOSE #1
            CALL DLLPRINT "test.dis,,,/80"
            ' all done!
            ' Now delete the print file if required.
            The current release of DOSPRINT and DLLPRINT is 1.01. V1.20 is almost ready to be released, and all registered V1.x users will receive the upgrade for free.
            V1.20 has some helpful features:
            1. Optional Print Preview mode!
            2. Auto-formfeed, so lines of text automatically wrap to the next page if they touch the edge of the printable area.
            3. Outline font mode.
            4. Ability to specify the default font.
            5. ... and a whole lot more besides!

            V2.0 (the next version I am also working on) includes the ability to "embed" any number of images on the page, including BMP, JPG, TIFF, etc.

            Anyone interested in DOSPRINT or DLLPRINT can download demo versions from www.amerimports.com/dosprint
            Upon request, you can take a look at the final release candidate of version 1.2 (sans the updated doc's which I'm trying to finish off!)

            As this is a non-PowerBASIC product, you can discuss it with me via my personal email address: mailto:[email protected][email protected]xtra.co.nz</A>

            Regards,
            Lance.
            Lance
            mailto:[email protected]

            Comment

            Working...
            X