Load font from byte array #503
Unanswered
joaquingrech
asked this question in
Q&A
Replies: 1 comment
-
|
Can you share an example project please? Thanks |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a very old program using SharpDX and I want to migrate and update to Vortice. I've got everything working except for loading a custom font from a byte array.
I had something like this working before:
the 'Key' there was an old SharpDX.DataStream
Now, upgrading I have no idea how to achieve the same to be able to load that byte[] data which is a font data, into memory. I began with a simple
static internal class font
{
static internal IDWriteFontCollection get_font_collection(IDWriteFactory dw_factory, byte[] data)
{
ResourceFontLoader CurrentResourceFontLoader = new ResourceFontLoader(dw_factory, data);
// return new FontCollection(dw_factory, CurrentResourceFontLoader, CurrentResourceFontLoader.Key);
return dw_factory.CreateCustomFontCollection(
CurrentResourceFontLoader,
Cx,
y);
}
}
Key there is Vortice.DataStream but it does not seem to work. Also CreateCustomFontCollection has 3 parameters instead of 2 and I have no idea what to do. Anyone has example of custom loading fonts from byte data?
Beta Was this translation helpful? Give feedback.
All reactions