398
Platforms
©2000-2008 Tibbo Technology Inc.
Once the font has been successfully selected, the
and
R/O properties will tell you the maximum height of characters
in this font and how pixel data is packed within the font file. The meaning of the
first one is obvious. The meaning of the second one will become apparent after
(and if) you read
. If you don't want to read this,
it's OK too, we can just go straight to the summary:
Fonts can be encoded horizontally or vertically, and the lcd.fontpixelpacking will
tell you what type of font you have selected. You should only care about this for
displays with
<8. if your display has lcd.bitsperpixel>8 then it
doesn't matter what kind of font you use. If it is <8, then you are better off
selecting a font for which lcd.fontpixelpacking is equal to
(depends on selected controller/panel). You achieve better performance when
these two properties are "aligned". It will also work if you select a font which is
"perpendicular" to your display, but text printing might slow down considerably.
We typically offer two versions for each font, for example, "Tibbo-5x7(V).bin" and
"Tibbo-5x7(H)". V stands for "vertical" and "H" stands "horizontal".
Non-aligned text
Once the font has been selected, you can start printing. You do this with the
method. This method always produces a single-line output. Two properties
and
-- affect how your text is
printed. The reference point of your text is at the top-left pixel of the output. X and
Y arguments of lcd.print specify this corner, and the text is rotated "around" this
pixel as well. Example:
lcd.print("Text",30,10)
lcd.textorientation=PL_LCD_TEXT_ORIENTATION_180
lcd.texthorizontalspacing=4
lcd.print("Text",30,10)
Lcd.print returns the total width of produced textual output in pixels. This can be
very useful. Here is an example where you draw a frame around the text, and you
want the frame size to be "just right":
x=lcd.print("Text",30,10)
lcd.rectangle(28,8,30+x+1,10+lcd.fon1)
Sometimes, it is desirable to know the width of the text output before actual
printing.
will tell you how many pixels will be taken by your
418
419
400
414
425
425
430
430
420