Forum > General

[SOLVED] Font question

<< < (2/4) > >>

Pe3s:
I have this thought, it is easier to load a font from disk than from resources

KodeZwerg:
I prefer using my class, easy in handling, works for me on Windows flawless.

Thaddy:

--- Quote from: Pe3s on March 26, 2023, 05:57:05 pm ---I have this thought, it is easier to load a font from disk than from resources

--- End quote ---
There is not much difference in complexity.
What is different is that you do not have to provide the font as a separate file, which is important.
(KodeZwerg 's code is way over-compicated, but will do what you mean.)

The snippet you found is very close to what I published.

KodeZwerg:

--- Quote from: Thaddy on March 26, 2023, 07:36:13 pm ---(KodeZwerg 's code is way over-compicated, but will do what you mean.)
--- End quote ---

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---if FFonts.LoadResourceFont(HInstance, 1, RT_FONT) thenTotal overcomplicated... I see and laugh out loud.

Pe3s:
Unable to load font from resource by way

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---var  Stream: TResourceStream;begin  Stream := TResourceStream.Create(HInstance, 'MyFont', RT_RCDATA);  

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version