mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Developing font metrics
git-svn-id: svn://ultimatepp.org/upp/trunk@1215 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
03ed0ecc7d
commit
28c89ba4e5
2 changed files with 72 additions and 0 deletions
9
uppdev/FontMetrics/FontMetrics.upp
Normal file
9
uppdev/FontMetrics/FontMetrics.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
uses
|
||||
CtrlLib;
|
||||
|
||||
file
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
63
uppdev/FontMetrics/main.cpp
Normal file
63
uppdev/FontMetrics/main.cpp
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
struct CharMetrics {
|
||||
int16 width;
|
||||
int16 lspc;
|
||||
int16 rspc;
|
||||
};
|
||||
|
||||
struct FontMetrics {
|
||||
int refcount;
|
||||
Font font;
|
||||
int angle;
|
||||
int device;
|
||||
#ifdef PLATFORM_WIN32
|
||||
HFONT hfont;
|
||||
#endif
|
||||
#ifdef PLATFORM_XFT
|
||||
XftFont *xftfont;
|
||||
XftFont *xftfont0;
|
||||
#endif
|
||||
int ascent;
|
||||
int descent;
|
||||
int external;
|
||||
int internal;
|
||||
int height;
|
||||
int lineheight;
|
||||
int overhang;
|
||||
Size offset;
|
||||
int avewidth;
|
||||
int maxwidth;
|
||||
int firstchar;
|
||||
int charcount;
|
||||
int default_char;
|
||||
|
||||
CharMetrics *base[64];
|
||||
|
||||
Mutex xmutex;
|
||||
Vector<Kinfo> kinfo;
|
||||
VectorMap<dword, CharMetrics> xx;
|
||||
|
||||
bool fixedpitch;
|
||||
bool scaleable;
|
||||
int spacebefore;
|
||||
int spaceafter;
|
||||
#ifdef PLATFORM_X11
|
||||
int underline_position;
|
||||
int underline_thickness;
|
||||
double sina;
|
||||
double cosa;
|
||||
bool twobyte;
|
||||
String filename;
|
||||
#endif
|
||||
};
|
||||
|
||||
FontMetrics GetFontMetrics(Font fnt);
|
||||
CharMetrics GetCharMetrics(Font fnt, int chr);
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue