Forum > LazUtils

[LazFreeType] Resource Font

(1/5) > >>

hi, using FreeType in my app I'd like to load custom font from resource.
Failed to substitute resource stream instead of the file stream in FreeType
because of lots of file related code, I wrote my own function to load font
face from resource. 

Could anybody help me to insert loaded face into FreeType instance?
I have not enough experience to do it myself, but don't mind to share
my work with community.

Hello, can you explain the modifications you propose to apply ?

hello circular,

i'd like to add

--- Code: ---LoadFromResource (const ResourceName: String)
--- End code ---
method into TFreeTypeFont type.

actually, this one is 90% ready (see attach on the 1st post),
still can't insert loaded object into existing TFreeTypeFont
data scructure.

I think I get it, well, the code you propose comes from deeper FreeType units, so I suppose it should not be put directly TFreeTypeFont type.

More over, I suppose you are writing twice the loading code, which must be in some deeper FreeType units, right?

you are correct, my code is similar to the existing code,
but that one is based onto file operations too tight, and
also separated into many small hierarchical functions.

it seems 'canonical' approach will be very time-consuming:
since i can't override functions enclosed into very depth,
i need to rewrite entire module 'from scratch'!
(i.e. EazyLazFreeType, LazFreeType and TTCache)

bypass the existing code is a 'tricky' way, but probably
is the shortest path to the goal.  :-[


[0] Message Index

[#] Next page

Go to full version