Announcement

Collapse
No announcement yet.

xprint -multiple font sizes, multiple fonts

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

  • xprint -multiple font sizes, multiple fonts

    Here is my objective:
    To print a fixed message on a postcard 4 inches tall and 6 inches wide.
    I will be using a dot matric epson lq570e.
    This is a continuous form situation.
    I want to use multiple size fonts, maybe different fonts too.
    For example the top line in large print. Then the rest of the lines
    in smaller print, maybe different font too.

    How can I calculate the printing so as to start the next postcard
    properly? I want to print many postcards with the same
    message.

    Thank you for any suggestions.

    ------------------

  • #2
    If XPRINT FORMFEED does not do what you want there are several
    alternatives.

    Use Ddoc or dllprint or format it with epson codes and bypass
    the print driver (examples of this are in the source code forum).

    I know that dllprint (and bypass) would allow a
    PRINT #printer,CHR$(12);

    the semicolon being important to be at the same starting point
    as the previous page.

    but even with the xprint formfeed you should be able to do an
    XPRINT SET POS x!,y! to set the correct line/column to start.
    Check out the XPRINT SCALE too. (assuming printer has a valid
    windows driver in order to use XPRINT successfully).



    ------------------
    Client Writeup for the CPA


    mailto:buff_oasys@yahoo.combuff_oasys@yahoo.com</A>
    Client Writeup for the CPA

    buffs.proboards2.com

    Links Page

    Comment


    • #3
      Tom,

      The easy way is to use LPRINT instead of XPRINT.
      On that kind of printer, graphic print will be painfully slow and
      the end result not very pretty.

      Your Epson can print 6 or 8 lines per inches and the built in font
      can do 5, 10,12 or 20 caracter per inches.

      If you use the 6 line mode, each form will be 24 lines high and
      the 8 LPI mode would be 32.
      So your problem is very to solve in line printer mode.

      Chr$(14)=5 CPI
      Chr$(18)+Chr$(20)=10 CPI
      Chr$(27)+Chr$(77)=12 CPI
      chr$(15)=20 CPI



      ------------------
      Old QB45 Programmer
      Old QB45 Programmer

      Comment


      • #4
        Thanks for replies so far.
        I probably don't have a solid understanding of the underlying
        basis for xprint. Here are some observations. I tested printing on a continuous form
        to print what would have continued for several pages. But the print stopped as the first page was completed.
        This told me that a formfeed must be called for. Since I am shooting for a small form 4inches by 6 inches
        I think I must then tell the computer the size of the form. I am thinking that
        the xprint scale command is the one to use. (thanks for reference)
        Maybe i should use an xprint get lines to see if I am close to the end of my form.
        My problem is that I want to change font sizes several times so I don't
        know if xprint get lines can handle the math? I will experiment.
        As suggested I could use a xprint set pos to start a new form but I
        think I will still have to execute a formfeed first.

        If I were content with all printing of the same size I could use LPRINT
        and save a lot of uncertainty. But why not try this idea. You need to read my first message to get the whole idea
        of what I want to do.

        Thanks again.

        ------------------

        Comment


        • #5
          Tom,

          My method would be to define a 4 by 6 form in your printer's
          print setup ( adding about 1/4 inch or so for spacing between ).
          I'm not exactly sure how to do this for your printer but when
          you select your printer there is usually a tab to also select the
          paper size. on that tab there should be a User Defined selection.
          You can define the paper layout there and save it under a new
          name. then just select that for paper type.

          Doing an Xprint Scale would allow you to locate each piece of
          text in inches instead of pixels ( or whatever unit it defaults
          to ). It will be easier to do this so that you can easily make
          changes if needed later on.

          Since you know exactly how much you print on each card then
          do an XPrint FormFeed and it should advance to the top of the
          next card. Then you just start all over. You might have to make
          allowances for margins but if you practice using regular paper
          instead of the cards then it shouldn't take too long to get
          it all lined up. I've done similar things for checks and
          envelopes but am doing single feeds instead of continuous
          forms.

          Hope this helps. If you have more questions, just ask.


          ------------------

          Comment


          • #6
            Tom,

            Paul's method should work.
            But if you use the SCALE command, and you use XPRINT SET POS
            to position each line of text in inches, you won't need to
            change anything in your printer setup.
            A simple line counter will do the job


            ------------------
            Old QB45 Programmer
            Old QB45 Programmer

            Comment


            • #7
              ????
              No such thing as
              Code:
              XPRINT SET PAPERSIZE x, y
              ????

              There's a set orientation, but no paper size?

              Well, no sense crying over spilt milk.

              That said... I would think there would be a way to get/set paper size eitter from the DC plus maybe the current SCALE settings.. or possibly by opening the printer via WinApi methods?

              ???

              Comment


              • #8
                DocumentProperties maybe?
                The DocumentProperties function retrieves or modifies printer initialization information or displays a printer-configuration property sheet for the specified printer.
                Includes a DEVMODE which includes papersize....

                ???

                Or maybe SetPrinter? That also has a DEVMODE option...



                [This message has been edited by Michael Mattias (edited October 17, 2006).]

                Comment


                • #9
                  I have to print all kinds of report with different fonts on
                  different sections and here is the way I do it.

                  XPRINT GET CLIENT TO Pwide!,Phigh! ' Printer range in pixels
                  XPRINT SCALE (1,1)-(Pwide!,Phigh!) ' Scale in pixels
                  XPRINT FONT "Courier New",Point,1 ' Chose your font and size
                  XPRINT CHR SIZE TO Cwide!,Chigh! ' Find size of caracters
                  Caracter=Pwide!/Cwide! ' Caracters per lines
                  Maxlines=Phigh!/Chigh! ' Numbers of lines on paper
                  XPRINT SCALE (1,1)-(80,66) ' Setup printer

                  If you use a 12 point font you will get a nice 10 caracters per inches
                  and 6 lines per inches like your native line printer.
                  Of course, your postcard are smaller than 8 1/2 x 11 but use
                  only what is needed.
                  You can change font and point size as often as you want but
                  the number of lines will be more complex to calculate.

                  ------------------
                  Old QB45 Programmer
                  Old QB45 Programmer

                  Comment


                  • #10
                    Thank you all for your comments.

                    I am using an epson lq570e dot matrix printer. I followed an example for
                    xprint scale. But my printer paid no attention to the scale I set. It formfeed
                    as if it were 8.5x11 paper, not 4 x 6 card.

                    On the control panel for the printer there is a properties selection of paper to use like A4, German fanfold etc but nothing for
                    4 x 6 card. On the printer itself there is the ability to change the default for
                    paper tractor control to sizes from 3 inches to 17 inches.
                    I could do this.

                    So my conclusion is that the xprint scale has limited power to change form size
                    by itself. Maybe other printers/drivers work differently? They do respond to the
                    xprint scale command. Is this a reasonable conclusion?


                    ------------------

                    Comment


                    • #11
                      Tom,

                      On the same place that showed the different paper sizes, down
                      at the bottom of the list, is where there is a User Defined size.
                      This is where you would define your 4 by 6 postcard size and
                      save it under a meaningful name. then select that name. this will
                      tell Windows & the driver the size of the paper and you should
                      get the correct amount when doing a form-feed.

                      As I stated, it would probably be cheaper to use regular paper
                      instead of the postcards for testing. But still select the
                      post-card size that you defined. This is just for testing to
                      get the layout and allow for margins & such and to make sure
                      that the fonts look okay without wasting good post-cards.


                      ------------------

                      Comment


                      • #12
                        to Paul Elliott
                        The list of possible forms has no scroll bar and no "user defined"
                        selection choice. This is a dot matrix. There is an option called
                        "not available"

                        But more to the point I have come to believe that xprint scale has
                        nothing to do with papersize, just a way of easily identifying
                        particular coordinates on a page.

                        I might try using "not available" and changing the tractor control
                        on the printer to 4 inches.

                        This has been a valuable exercise for me. I have a solution using
                        LPRINT (but no font size changes).

                        Thank you for your information.

                        ------------------

                        Comment


                        • #13

                          Tom -

                          in ancient history I did a lot of hairy Epson LQ1050 stuff.

                          you probably know there is an Epson "printer language" - the ole' ESCape codes.
                          this allowed setting most anything on the printer - including margins, size, font, etc.

                          I wonder if you used ESC sequences inside PB, sent directly to the dot matrix, if the paper size would "stick" or if the Windows driver would overwrite them?

                          I have a glimmer hope for that approach because I had several old QB and PB programs that output directly to the printer and when run under W95 and W98 still functioned "perfectly" with an Epson ink jet.
                          it's only a glimmer because that was all done using LPRINT; invoking XPRINT ATTACH most certainly brings the Windows driver into play which may "initialize" the printer to defaults, rather than moving forward from it's last settings.....

                          if XPRINT overwrites the printer settings, I'd be tempted to try sending the ESC sequences after XPRINT ATTACH to see if the sequences are accurately output to the printer via Windows/XPRINT



                          ------------------

                          Comment


                          • #14
                            > on a postcard 4 inches tall and 6 inches wide.

                            Shot in the dark:

                            You sure that postcard isn't four and one-quarter inches high?

                            I think that would make it exactly two cards per 8-1/2 x 11 "page" after an "XPRINT SET ORIENTATION 2" statement....



                            Comment

                            Working...
                            X