TOPIC: Printing Color and Bold
#942
Printing Color and Bold 3 Years, 1 Month ago
I have two questions about printing a report. First, when I want something bolded (e.g., weight:800), it is bolded in the print preview but not on paper. Why is that?

Secondly, how does one print a field in a color like red?

Thanks.

Post edited by: peaslee, at: 2007/07/07 22:27
 
 
#945
Re:Printing Color and Bold 3 Years, 1 Month ago
I am not sure why bold would show in preview but not in print. I have not heard about this problem before. What kind of printer? Are you using "draft" or "economy" mode?

You can specify an RGB color value to TextFormat e.g. color: RGB(255, 0, 0) would be red (but RGB() is a function so you can not use it in a constant). You can specify it in hex, but the colors are backwards, e.g. red would be color: 0x0000ff (I see the color: option is not documented - I will add it.)

Post edited by: andrew, at: 2007/07/09 00:37
 
 
andrew
 
#946
Re:Printing Color and Bold 3 Years, 1 Month ago
Bold now works. I took it out before asking the question and put it back now. I must have coded it improperly.

As to color:

Code:


#('Horz'
(lotNumber     width:6  justify:"left"  font:'(name: Ariel size:10 weight:800))
(Text " "      width:6                  font:'(name: Ariel size:10))
(fullAddress   width:35 justify:"left"  font:'(name: Ariel size:10))
(Text '$'               justify:"right" font:'(name: Ariel size:10))
(purchasePrice width:11 justify:"right" font:'(name: Ariel size:10))
(upgradesCost  width:11 justify:"right" font:'(name: Ariel size:10))
(Text '$'      width:11 justify:"right" font:'(name: Ariel size:10) color:0x0000ff)
(totalCost     width:11 justify:"right" font:'(name: Ariel size:10) color:0x0000ff)



Note the last two lines. The "$" is red, but totalCost is not.

Post edited by: peaslee, at: 2007/07/09 01:34
 
 
#948
Re:Printing Color and Bold 3 Years, 1 Month ago
I am guessing that totalCost is a NumberFormat and I see that NumberFormat does not accept a color argument. I have added it to NumberFormat and OptionalNumberFormat. The changes are simple if you want to add them to your stdlib, here is the relevant part of NumberFormat:

Code:

New(data = false, mask = false, width = false, w = false, font = false,
    [color=#FF0000]color = false[/color])
    {
    super(data is false ? false : .Convert(data),
        mask: mask, width: width, w: w, font: font, [color=#FF0000]color: color[/color])


The changes are the same for OptionalNumberFormat.
 
 
andrew
 
#949
Re:Printing Color and Bold 3 Years, 1 Month ago
That's right, and this adds the feature.

It's funny nobody asked about color printing of numbers. Maybe I'm just awash in red ink ;)