ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Font lost with variable line position

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

  • Font lost with variable line position

    We have varying fonts used on forms printed on *AFPDS printers, using FNTCHRSET in the printer files. When we specify the POSITION exactly, the FNTCHRSET is used for printing as requested. However, if we use a variable for the line in POSITION, the FNTCHRSET seems to be ignored.

    Example which prints fine using Helvetica Italic Bold:
    ------------
    A R PRTLIN
    A #DESC 30 TEXT('DESCRIPTION')
    A FNTCHRSET(C0H50000 T1V10037)
    A POSITION(1.500 .600)
    ------------

    Example changed, and which prints in the correct position, but now ignores the selected font:
    ------------
    A R PRTLIN
    A #DESC 30 TEXT('DESCRIPTION')
    A FNTCHRSET(C0H50000 T1V10037)
    A POSITION(&LINE .600)
    A LINE 5S 3P
    ------------

    Thanks! - kc5f

  • #2
    Re: Font lost with variable line position

    I really never use the position keyword.......sorry but I often use the Font keyword rather than the fntchrset.

    you could try that take a look at this example


    also I have posted the fonts somewhere in this forum ill look around

    welcome to code400 and what r u doing @ work today?


    here they are



    Happy NewYear
    jamie
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: Font lost with variable line position

      Jamie,

      Thanks for the welcome! And were you asking what it is I'm doing while I'm at work, or why it is I happen to be at work today?! I'm here because I'm covering for most everybody else, out on vacation, and I'm working on several AS/400 projects, just like every other day...

      Per your suggestion, I tried the FONT code instead of FNTCHRSET, but interestingly enough, it had the same results. Here's what I'm running into with either FNTCHRSET or FONT:

      1) In a simple or complex program, when I specify POSITION(1.500 .600) it gives me the correct font.

      2) In a simple program (no OVRPRTF, set variables, a few WRITES and end the job), when I specify POSITION(&LINE .600) with &LINE equal to 1.500 it gives me the same (correct) output as above.

      3) In a complex program (OVRPRTF, lots of loops and WRITES), when I specify POSITION(&LINE .600), &LINE always correctly positions the output, but the font is now the same as the most recently printed lines.

      Oh well, time to do some deeper-level searching!

      Comment


      • #4
        Re: Font lost with variable line position

        Sorry I wasnt any help and also that you are at work today.

        Let us know what you figure out please.

        Take care and Happy New Year!

        Jamie
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment


        • #5
          Re: Font lost with variable line position

          I guess it never occurred to me that I should have today off! I just got finished with two months of ten hour days seven days a week, so this feels like vacation to me!

          Just in case anyone has any ideas, I'm still open to suggestions. Here's the line I want to change the font in, and the one printed just before it. The only RPG between the writes calculates the value of LINE and sets other variables.

          Code:
                                                                          
               A          R LIN001                                               
               A            #QTY           3  0       EDTCDE(Z)                  
               A                                      FNTCHRSET(C0440000 T1V10037)
               A                                      POSITION(&LINE .5)         
               A            #ITM          15                                     
               A                                      FNTCHRSET(C0440000 T1V10037)
               A                                      POSITION(&LINE 1.20)       
               A            #DSC          70          
               A                                      FNTCHRSET(C0440000 T1V10037)
               A                                      POSITION(&LINE 2.40)        
               A            LINE           5S 3P                                  
                *                                                                 
               A          R LIN002
               A            #DS2          70 
               A                                      FNTCHRSET(C0H50000 T1V10037)
               A                                      POSITION(&LINE .600)       
               A            LINE           5S 3P                                 
                *
          As I mentioned, if I replace the FNTCHRSET statements with the appropriate FONT statements, the results are the same - the second line prints using C0440000 (Courier) instead of C0H50000 (Helvetica Italic Bold).

          Thanks!

          Comment


          • #6
            Re: Font lost with variable line position

            Well, it turns out the programmer saying "change this code" was in the wrong part of the 4000-line program. When we figured out what it was really doing, we were able to change the DDS for that section and it worked just fine.

            (I hope none of you spent a whole lot of time investigating this. Thanks, in any case!)

            - Steve

            Comment


            • #7
              Re: Font lost with variable line position

              Thank God I can now focus on other stuff.

              Take care glad you got it solved.....


              Jamie
              All my answers were extracted from the "Big Dummy's Guide to the As400"
              and I take no responsibility for any of them.

              www.code400.com

              Comment

              Working...
              X