Skip to content

Commit

Permalink
Added RWops versions of OpenFont to support loading TTFs from memory.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Gravelyn committed May 31, 2014
1 parent 48bae22 commit 1c62615
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/SDL2_ttf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ public static extern IntPtr TTF_OpenFont(
int ptsize
);

/* IntPtr refers to a SDL_RWops* */
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr TTF_OpenFontRW(
IntPtr src,
int freesrc,
int ptsize
);

/* IntPtr refers to a TTF_Font* */
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr TTF_OpenFontIndex(
Expand All @@ -109,6 +117,15 @@ public static extern IntPtr TTF_OpenFontIndex(
long index
);

/* IntPtr refers to a SDL_RWops* */
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr TTF_OpenFontIndexRW(
IntPtr src,
int freesrc,
int ptsize,
long index
);

/* font refers to a TTF_Font* */
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int TTF_GetFontStyle(IntPtr font);
Expand Down

0 comments on commit 1c62615

Please sign in to comment.