flat assembler
Message board for the users of flat assembler.
Index
> Windows > How change font size without create again font ? |
Author |
|
Furs 02 Jan 2021, 14:05
If by "creating again font" you mean CreateFont, then no, you can't. That's what CreateFont is for. Note that the font it "creates" is just a handle, it's not like it takes a massive amount of resources or anything.
Obviously it has to be recreated because a smaller font might have a different match, depending on the source. |
|||
02 Jan 2021, 14:05 |
|
Roman 02 Jan 2021, 15:06
Furs wrote: If by "creating again font" you mean CreateFont, then no, you can't. Yes. |
|||
02 Jan 2021, 15:06 |
|
Ali.Z 02 Jan 2021, 16:00
as Furs said, you cant avoid font creation functions. (CreateFont / CreateFontIndirect)
i personally would go for CreateFontIndirect, get my logfont structure populated by ChooseFont and pass it to CreateFontIndirect. if you do so, remember to send your edit control WM_SETFONT message, delete old font (DeleteObject) and invalidate client rectangle to force redrawing. _________________ Asm For Wise Humans |
|||
02 Jan 2021, 16:00 |
|
revolution 02 Jan 2021, 23:49
Each time you use CreateFont* the OS has to find a raster representation of the characters. All modern fonts are in vector form and it is impossible to directly render them on a raster device like an LCD monitor, they have to be converted.
If the OS has some characters already in a cache somewhere and all the parameters match (i.e. size, escapement, weight, etc.) then it can reuse the old renderings. Otherwise it will create a new rendering for each new character you print. On modern hardware this isn't a big deal, and is quite fast, but if you are using older hardware there can be a perceivable delay each time new font parameters are selected. |
|||
02 Jan 2021, 23:49 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.