Advanced Strategic Command
|
Handling the fonts of ASC. More...
#include <cstring>
#include <stdio.h>
#include <errno.h>
#include <stdarg.h>
#include <stdlib.h>
#include <math.h>
#include "global.h"
#include "newfont.h"
#include "stack.h"
#include "basestrm.h"
#include "misc.h"
#include "basegfx.h"
Go to the source code of this file.
Classes | |
class | InitNewfont |
Macros | |
#define | blockread(a, b, c) fread(b,1,c,a) |
#define | seek(a, b) fseek(a,b,SEEK_SET) |
#define | spacewidthkey (int('n')) |
Typedefs | |
typedef dacpalette256 | dacpal |
Functions | |
void | expand (void *p1, void *q1, int size) |
pfont | loadfont (tnstream *stream) |
void | shrinkfont (pfont font, int diff) |
int | gettextwdth (const char *txt, pfont font) |
void | showtext3 (const char *txt, int xpos, int ypos) |
void | showtext3c (const char *txt, int xpos, int ypos) |
void | showtext4 (const char *TextToOutput, int x1, int y1,...) |
void | showtext4c (const char *TextToOutput, int x1, int y1,...) |
char * | int2string (int i, char *buf) |
Variables | |
const char * | fontid = "I\'m a font file on your Disk. Leave me alone !\x01A\x0A0" |
tfontsettings | activefontsettings |
class InitNewfont | initnewfont |
Handling the fonts of ASC.
The routines for displaying fonts can be found in basegfx.cpp (function showtext ). Although the file name contains is called newfont, the time when this was actually the case is long past (1993)...
Definition in file newfont.cpp.
#define blockread | ( | a, | |
b, | |||
c | |||
) | fread(b,1,c,a) |
Definition at line 42 of file newfont.cpp.
#define seek | ( | a, | |
b | |||
) | fseek(a,b,SEEK_SET) |
Definition at line 43 of file newfont.cpp.
#define spacewidthkey (int('n')) |
Definition at line 47 of file newfont.cpp.
Referenced by loadfont().
typedef dacpalette256 dacpal |
Definition at line 49 of file newfont.cpp.
void expand | ( | void * | p1, |
void * | q1, | ||
int | size | ||
) |
Definition at line 53 of file newfont.cpp.
Referenced by loadfont().
int gettextwdth | ( | const char * | txt, |
pfont | font | ||
) |
Definition at line 217 of file newfont.cpp.
References tfont::character, tfontsettings::font, tfont::kerning, tcharacter::size, and tcharacter::width.
Referenced by tviewtext::displaysingleline(), tviewtext::displaytext(), tdialogbox::gettextwdth_stredit(), tchoice_dlg::init(), tdisplaymessage::init(), int2string(), tdialogbox::intedit(), tdialogbox::lne(), tdialogbox::rahmen3(), showtext3(), and showtext3c().
char* int2string | ( | int | i, |
char * | buf | ||
) |
Definition at line 448 of file newfont.cpp.
References digit, gettextwdth(), itoa(), tfontsettings::length, and strrr().
Definition at line 107 of file newfont.cpp.
References toldfont::caps, tfont::caps, toldfont::character, tfont::character, toldfont::color, tfont::color, expand(), fontid, toldfont::groundline, tfont::groundline, toldfont::height, tfont::height, toldfont::id, toldfont::kernchartable, toldfont::kerning, tfont::kerning, toldcharacter::memposition, tcharacter::memposition, toldfont::name, tfont::name, toldfont::palette, tfont::palette, toldfont::read(), tnstream::readdata(), tnstream::readWord(), toldcharacter::size, tcharacter::size, spacewidthkey, toldfont::useems, toldcharacter::width, and tcharacter::width.
Referenced by load_font().
void showtext3 | ( | const char * | txt, |
int | xpos, | ||
int | ypos | ||
) |
Definition at line 246 of file newfont.cpp.
References tfontsettings::background, centertext, tfontsettings::color, gettextwdth(), tfontsettings::justify, lefttext, tfontsettings::length, tfontsettings::markcolor, npop, npush, righttext, and showtext2().
Referenced by tdialogbox::enablebutton().
void showtext3c | ( | const char * | txt, |
int | xpos, | ||
int | ypos | ||
) |
Definition at line 337 of file newfont.cpp.
References tfontsettings::background, centertext, tfontsettings::font, gettextwdth(), tfontsettings::justify, lefttext, tfontsettings::length, tfontsettings::markfont, npop, npush, righttext, and showtext2c().
Referenced by infomessage().
void showtext4 | ( | const char * | TextToOutput, |
int | x1, | ||
int | y1, | ||
... | |||
) |
Definition at line 416 of file newfont.cpp.
References showtext2().
void showtext4c | ( | const char * | TextToOutput, |
int | x1, | ||
int | y1, | ||
... | |||
) |
Definition at line 428 of file newfont.cpp.
References showtext2c().
void shrinkfont | ( | pfont | font, |
int | diff | ||
) |
Definition at line 206 of file newfont.cpp.
References tfont::character, tfont::kerning, and tcharacter::size.
Referenced by loadLegacyFonts().
tfontsettings activefontsettings |
Definition at line 51 of file newfont.cpp.
Referenced by tplayerchange::anzeige(), tdialogbox::buildgraphics(), thelpsystem::buildgraphics(), tmapgenerator::buttonpressed(), tparagraph::checkscrolldown(), tdialogbox::disablebutton(), tparagraph::display(), tparagraph::displaycursor(), tviewtext::displaysingleline(), tviewtext::displaytext(), tdialogbox::done(), tdialogbox::editfield(), tdialogbox::enablebutton(), tviewtext::evalcommand(), tdialogbox::execbutton(), tviewtext::fillline(), infomessage(), tmapgenerator::init(), ttributepayments::init(), tdialogbox::init(), MultilineEdit::init(), tresearchinfo::init(), tstringselect::init(), tchoice_dlg::init(), BuildingValues::init(), tbi3preferences::init(), ResizeMap::init(), tres::init(), tminestrength::init(), tdisplaymessage::init(), MirrorMap::init(), tdialogbox::intedit(), tdialogbox::lne(), loadLegacyFonts(), mapeditorMainThread(), tviewtext::nextline(), tdialogbox::rahmen3(), tviewanytext::redraw(), tdialogbox::redraw(), tparagraph::reflow(), tviewtext::setnewlineheight(), tviewtext::setparams(), setstartvariables(), showtext(), showtext2(), tdialogbox::stredit(), tdialogbox::tdialogbox(), tshowhistorypaintstat(), tstringselect::viewtext(), and tdialogbox::~tdialogbox().
const char* fontid = "I\'m a font file on your Disk. Leave me alone !\x01A\x0A0" |
Definition at line 45 of file newfont.cpp.
Referenced by loadfont().
class InitNewfont initnewfont |