mirror of
https://github.com/raylib-cs/raylib-cs
synced 2025-04-05 11:19:39 -04:00
Review font functions
This commit is contained in:
parent
f5e3c38887
commit
1db5428786
Raylib-cs
@ -1431,7 +1431,7 @@ namespace Raylib_cs
|
||||
|
||||
/// <summary>Load font from file with extended parameters</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Font LoadFontEx(sbyte* fileName, int fontSize, int[] fontChars, int charsCount);
|
||||
public static extern Font LoadFontEx(sbyte* fileName, int fontSize, int* fontChars, int glyphCount);
|
||||
|
||||
/// <summary>Load font from Image (XNA style)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
@ -1440,19 +1440,19 @@ namespace Raylib_cs
|
||||
/// <summary>Load font from memory buffer, fileType refers to extension: i.e. "ttf"<br/>
|
||||
/// fileData refers to const unsigned char *</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Font LoadFontFromMemory(sbyte* fileType, byte* fileData, int dataSize, int fontSize, int[] fontChars, int charsCount);
|
||||
public static extern Font LoadFontFromMemory(sbyte* fileType, byte* fileData, int dataSize, int fontSize, int* fontChars, int glyphCount);
|
||||
|
||||
/// <summary>Load font data for further use</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern GlyphInfo* LoadFontData(byte* fileData, int dataSize, int fontSize, int[] fontChars, int charsCount, FontType type);
|
||||
public static extern GlyphInfo* LoadFontData(byte* fileData, int dataSize, int fontSize, int* fontChars, int glyphCount, FontType type);
|
||||
|
||||
/// <summary>Generate image font atlas using chars info</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Image GenImageFontAtlas(GlyphInfo* chars, Rectangle** recs, int charsCount, int fontSize, int padding, int packMethod);
|
||||
public static extern Image GenImageFontAtlas(GlyphInfo* chars, Rectangle** recs, int glyphCount, int fontSize, int padding, int packMethod);
|
||||
|
||||
/// <summary>Unload font chars info data (RAM)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UnloadFontData(GlyphInfo* chars, int charsCount);
|
||||
public static extern void UnloadFontData(GlyphInfo* chars, int glyphCount);
|
||||
|
||||
/// <summary>Unload Font from GPU memory (VRAM)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
|
@ -590,10 +590,13 @@ namespace Raylib_cs
|
||||
}
|
||||
|
||||
/// <summary>Load font from file with extended parameters</summary>
|
||||
public static Font LoadFontEx(string fileName, int fontSize, int[] fontChars, int charsCount)
|
||||
public static Font LoadFontEx(string fileName, int fontSize, int[] fontChars, int glyphCount)
|
||||
{
|
||||
using var str1 = fileName.ToUTF8Buffer();
|
||||
return LoadFontEx(str1.AsPointer(), fontSize, fontChars, charsCount);
|
||||
fixed (int* p = fontChars)
|
||||
{
|
||||
return LoadFontEx(str1.AsPointer(), fontSize, p, glyphCount);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Upload vertex data into GPU and provided VAO/VBO ids</summary>
|
||||
|
Loading…
x
Reference in New Issue
Block a user