diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Wasabi/api/font/font.h | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/Wasabi/api/font/font.h')
-rw-r--r-- | Src/Wasabi/api/font/font.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/Src/Wasabi/api/font/font.h b/Src/Wasabi/api/font/font.h new file mode 100644 index 00000000..8e1f15f2 --- /dev/null +++ b/Src/Wasabi/api/font/font.h @@ -0,0 +1,55 @@ +#ifndef __FONT_H +#define __FONT_H + +#include <bfc/ptrlist.h> +#include <bfc/string/StringW.h> + +class ifc_canvas; +class svc_font; +class svc_fontMaker; + +class FontDef { + public: + StringW filename; + StringW path; + StringW id; + int allowmapping; + int isbitmap; + int scriptid; +}; + +class Font { + public: + static void init(); + + static svc_font *installTrueTypeFont(const wchar_t *filename, const wchar_t *path, const wchar_t *id, int scriptid, int allowmapping, int isreload); // call this to install a new font + static void installBitmapFont(const wchar_t *filename, const wchar_t *path, const wchar_t *id, int charwidth, int charheight, int hspacing, int vspacing, int scriptid, int allowmapping); + static void uninstallAll(int isttfreload=0); + static void uninstallByScriptId(int scriptid); + + static svc_font *requestSkinFont(const wchar_t *id, int *size=NULL, int *gotdefault=NULL); // call this to get a Font pointer to a font id, pass your size if you have one, so that the mapper can do its job. + static void dispatchTextOut(ifc_canvas *c, int style, int x, int y, int w, int h, const wchar_t *txt); + static int dispatchGetInfo(ifc_canvas *c, const wchar_t *font, int infoid, const wchar_t *txt, int *w, int *h); + + static int useTrueTypeOverride(const wchar_t *txt); + static const wchar_t *getTrueTypeOverride(); + static int getTrueTypeOverrideScale(); + static int getNumFonts() { return fontlist.getNumItems(); } + + static FontDef *enumFontDef(int n) { return fontdefs.enumItem(n); } + static int getNumFontDefs() { return fontdefs.getNumItems(); } + + static const wchar_t *getFontMapping(const wchar_t *id, int *size); + + private: + static void deleteFont(svc_font *font); + static svc_font *newTrueTypeFont(); + + static PtrList<svc_font> fontlist; + static PtrList<FontDef> fontdefs; + StringW font_id; + int scriptid; + static StringW mapping; +}; + +#endif |