[Gambas-user] Printer Font Size Problem

Fabien Bodard gambas.fr at gmail.com
Fri Oct 18 06:20:44 CEST 2019


Le ven. 18 oct. 2019 à 04:59, Tony Morehen <tmorehen at ajm-software.com> a
écrit :

> While you are looking at the printer code, I've noticed the following:
> 1) In Printer_Begin(), I set Paint.Font to my target font.
> 2) When Printer_Draw is raised, Paint.Font has changed back to the
> default font. I expected that Paint.Font, once set, would remain
> unchanged for the entire print session.  Instead, I have to reset it in
> every draw event.
>
> On 2019-10-17 7:33 p.m., Benoît Minisini wrote:
> > Le 18/10/2019 à 02:29, Ed & Clare Kelm a écrit :
> >> Benoit:
> >>
> >> My apologies.  The font is Droid Sans.  Thank you for explaining the
> >> purpose of FontScale
> >>
> >> What is happening is "Paint.Font.Bold=TRUE" applies the FontScale to
> >> the Font.Size, and so does "Paint.Font.Bold=FALSE".
> >>
> >> In my case the FontScale is ~0.97. so every time I change the state of
> >> Font.Bold, the font shrinks a little bit.  In a page having lots of
> >> individual bold words, the font shrinks to extremely tiny!
> >>
> >> That can't be right.
> >>
> >> Also shouldn't the Font.Size be what I set?   In other words, if I say
> >> "Paint.Font.Size =14", shouldn't "a = Paint.Font.Size" set a to 14?
> >>
> >>
> >> Ed K.
> >>
> >>
> >
> > My apologies too, I now understand the problem. You are right, the font
> > scale is not applied once, but each time the Paint.Font property is
> > modified. This is not a problem if you set the font with a new font, but
> > it is if you change just a property of the font.
> >
> > I need to think about that mess...
> >
>
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>


Yes because paint is a context class and is new each paint.begin<>paint.end.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20191018/438fae07/attachment.html>


More information about the User mailing list