mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-02-17 17:11:19 +00:00
- added a kerning option to FONTDEFS
This commit is contained in:
parent
2907ba69a0
commit
2eb312e041
2 changed files with 10 additions and 0 deletions
|
@ -929,6 +929,7 @@ void V_InitCustomFonts()
|
||||||
int first;
|
int first;
|
||||||
int count;
|
int count;
|
||||||
int spacewidth;
|
int spacewidth;
|
||||||
|
int kerning;
|
||||||
char cursor = '_';
|
char cursor = '_';
|
||||||
|
|
||||||
while ((llump = Wads.FindLump ("FONTDEFS", &lastlump)) != -1)
|
while ((llump = Wads.FindLump ("FONTDEFS", &lastlump)) != -1)
|
||||||
|
@ -945,6 +946,7 @@ void V_InitCustomFonts()
|
||||||
first = 33;
|
first = 33;
|
||||||
count = 223;
|
count = 223;
|
||||||
spacewidth = -1;
|
spacewidth = -1;
|
||||||
|
kerning = 0;
|
||||||
|
|
||||||
sc.MustGetStringName ("{");
|
sc.MustGetStringName ("{");
|
||||||
while (!sc.CheckString ("}"))
|
while (!sc.CheckString ("}"))
|
||||||
|
@ -1004,6 +1006,11 @@ void V_InitCustomFonts()
|
||||||
}
|
}
|
||||||
format = 2;
|
format = 2;
|
||||||
}
|
}
|
||||||
|
else if (sc.Compare("KERNING"))
|
||||||
|
{
|
||||||
|
sc.MustGetNumber();
|
||||||
|
kerning = sc.Number;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (format == 1) goto wrong;
|
if (format == 1) goto wrong;
|
||||||
|
@ -1026,6 +1033,7 @@ void V_InitCustomFonts()
|
||||||
{
|
{
|
||||||
FFont *fnt = new FFont (namebuffer, templatebuf, nullptr, first, count, start, llump, spacewidth, donttranslate);
|
FFont *fnt = new FFont (namebuffer, templatebuf, nullptr, first, count, start, llump, spacewidth, donttranslate);
|
||||||
fnt->SetCursor(cursor);
|
fnt->SetCursor(cursor);
|
||||||
|
fnt->SetKerning(kerning);
|
||||||
}
|
}
|
||||||
else if (format == 2)
|
else if (format == 2)
|
||||||
{
|
{
|
||||||
|
@ -1050,6 +1058,7 @@ void V_InitCustomFonts()
|
||||||
FFont *CreateSpecialFont (const char *name, int first, int count, FTexture **lumplist, const bool *notranslate, int lump, bool donttranslate);
|
FFont *CreateSpecialFont (const char *name, int first, int count, FTexture **lumplist, const bool *notranslate, int lump, bool donttranslate);
|
||||||
FFont *fnt = CreateSpecialFont (namebuffer, first, count, &lumplist[first], notranslate, llump, donttranslate);
|
FFont *fnt = CreateSpecialFont (namebuffer, first, count, &lumplist[first], notranslate, llump, donttranslate);
|
||||||
fnt->SetCursor(cursor);
|
fnt->SetCursor(cursor);
|
||||||
|
fnt->SetKerning(kerning);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else goto wrong;
|
else goto wrong;
|
||||||
|
|
|
@ -104,6 +104,7 @@ public:
|
||||||
int GetCharCode(int code, bool needpic) const;
|
int GetCharCode(int code, bool needpic) const;
|
||||||
char GetCursor() const { return Cursor; }
|
char GetCursor() const { return Cursor; }
|
||||||
void SetCursor(char c) { Cursor = c; }
|
void SetCursor(char c) { Cursor = c; }
|
||||||
|
void SetKerning(int c) { GlobalKerning = c; }
|
||||||
bool NoTranslate() const { return noTranslate; }
|
bool NoTranslate() const { return noTranslate; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Reference in a new issue