Announcement

Collapse
No announcement yet.

How to Print With Embedded Tabs

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

  • Edwin Knoppert
    replied
    Let's not forget the printing capabilities a richedit control provides.

    Leave a comment:


  • Michael Mattias
    replied
    >Plus, it only works for fixed width fonts.

    Actually, any drawing command which supports tabstops works regardless of font.

    It's trying to use tab-stopped text with a proportional font which is Sysyphusian.

    MCM

    Leave a comment:


  • Edwin Knoppert
    replied
    You can use the DrawTextEx() API.
    The DRAWTEXTPARAMS structure will let you set the tab offset.

    Leave a comment:


  • Gary Beene
    started a topic How to Print With Embedded Tabs

    How to Print With Embedded Tabs

    I have a richedit control with embedded tabs in the content, placed there by using the Ctrl-I shortcut. When I print, the printer prints a symbol for the tabs, rather than expanding the tabs.

    This example shows the same result on a simple string with $tabs in it.

    Code:
    #Compile Exe
    Function PBMain () As Long
        Local temp$
        temp$ = "this is a test" + $Tab + $Tab + "this is the end of the test
        XPrint Attach Default
        XPrint temp$
        XPrint FormFeed
    End Function
    In the past, I have rarely used tabs, except in Print statements with columns of variables. But here, where the tabs are simply content within a richedit control, I don't have the content split between variables.

    I suppose I could print line by line, check the position of each $Tab, then selectively expand the tabs to spaces, to widen the text to the next preferred tab spot (10, 20, ... or whatever I chose). That seems like an excessive solution. Plus, it only works for fixed width fonts.

    How are embedded tabs usually handled with XPrint? It seems like a common enough task, but my forum search didn't turn up similar questions.
    Last edited by Gary Beene; 10 Aug 2009, 02:34 PM.
Working...
X