[Gambas-user] Again printing, here: how to change Font-properties?

Hans-Martin Bundeshund bundeshund at ...467...
Sat Jul 10 17:54:33 CEST 2004


Salute group,

now I tried to implement printing to my 'mercantile'-application 
'gambakaan' (kaan = kaufmännische Anwendung = mercantile-application if my 
translation is right). But I am doing somethin basicly wrong. When I trie to 
print a text using this:


###########################################
sub print_it() 
 DIM mytext AS String

  'init the printer  
  draw.begin(Printer)
  draw.font.Italic = TRUE
  draw.Font.size = 12

  'puzzeling my text
  		'I only do this for a better view of the lines 
  mytext =                "Line1"               & "\n"
  mytext = mytext & "Line2"               & "\n"
  mytext = mytext & "Line3"               & "\n"	

  draw.Text(mytext,200,200)
  draw.End
end
###########################################


the values .size, .italic and name (not seen in the example) make no sence to 
the output. I can enter italic = false or true, same result. 

So what must I do to activate my new settings?

And I have a second question: When I want to use different font-types with 
different sizes, I think I have to write the code like this:

###########################################
sub print_it() 
 DIM mytext AS String

  'init the printer for headline-text
  draw.begin(Printer)
  draw.font.Italic = TRUE
  draw.Font.size = 24

  'puzzeling my headlines
  mytext =                "Headline1"               & "\n"  'I only do this 
for a better view of the lines 
  mytext = mytext & "Hedaline2"               & "\n"
  draw.Text(mytext,200,200)


  'init the printer for bottom-text
  draw.begin(Printer)
  draw.font.Italic = TRUE
  draw.Font.size = 12

  'puzzeling my bottom-text
  mytext =                "Bottomtext1"               & "\n"
  mytext = mytext & "Bottomtext2"               & "\n"
  draw.Text(mytext,200,200+200)

  draw.End
end
###########################################

Thanks for your help,

HM




More information about the User mailing list