[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Web Font from WebControl font


On Sat, 30 Aug 2025 at 23:31, Benoît Minisini <
benoit.minisini@xxxxxxxxxxxxxxxx> wrote:

> Le 30/08/2025 à 23:11, Bruce Steers a écrit :
> >
> >
> > On Sat, 30 Aug 2025 at 22:04, Benoît Minisini <benoit.minisini@gambas-
> > basic.org <mailto:benoit.minisini@xxxxxxxxxxxxxxxx>> wrote:
> >
> >     Le 30/08/2025 à 22:57, Bruce Steers a écrit :
> >      > Could do with a nice way to set a new Font (gb.web.gui) from the
> >     string
> >      > of a control.
> >      >
> >      > I have this working but i do not know how robust it is...
> >      >
> >      >    Paint.Font = Font[Split(hWebObject.Font, ",
> >     ").Reverse().Join(" ")]
> >      >
> >      > Respects
> >      > BruceS
> >      >
> >
>


> Done in the last commit.
>
> Now the 'gb.web.gui' Font object string representation are, like with
> 'gb.gui', a comma separated list of font properties:
>
> Font["Arial,32px,bold,italic"]
>
> The "normal" property indicates that the font won't inherit the font
> properties of its parents.
>
> For detailed CSS font properties, you can use this kind of syntax:
>
> Font["weight:300,width:condensed,style:oblique,
>
> For the Paint class, the "normal" font property is ignored. And text
> decoration is emulated (only 'underline' and 'line-through'), as it is
> not supported by the canvas interface.
>
> Backward-compatibility with the old string Font property is ensured by
> 'gb.web.gui' and the IDE transparently (provided there is no bug in it).
>
> Regards,
>
> --
> Benoît Minisini


Excellent stuff.
now i can just simply do this..

Paint.Font = hControl.Font

Thank you good sir :)

BruceS

Follow-Ups:
Re: Web Font from WebControl fontBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
References:
Web Font from WebControl fontBruce Steers <bsteers4@xxxxxxxxx>
Re: Web Font from WebControl fontBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: Web Font from WebControl fontBruce Steers <bsteers4@xxxxxxxxx>
Re: Web Font from WebControl fontBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>