mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-27 14:37:16 +00:00
extra configuration for svg text
This commit is contained in:
parent
561c8e975c
commit
9df8f76b53
@ -99,7 +99,11 @@ EX namespace svg {
|
|||||||
|
|
||||||
string font = "Times";
|
string font = "Times";
|
||||||
|
|
||||||
|
ld text_width_multiplier = 1/40.;
|
||||||
|
int min_text = 3;
|
||||||
|
|
||||||
EX void text(int x, int y, int size, const string& str, bool frame, color_t col, int align) {
|
EX void text(int x, int y, int size, const string& str, bool frame, color_t col, int align) {
|
||||||
|
if(size < min_text) return;
|
||||||
|
|
||||||
double dfc = (x - current_display->xcenter) * (x - current_display->xcenter) +
|
double dfc = (x - current_display->xcenter) * (x - current_display->xcenter) +
|
||||||
(y - current_display->ycenter) * (y - current_display->ycenter);
|
(y - current_display->ycenter) * (y - current_display->ycenter);
|
||||||
@ -133,7 +137,7 @@ EX namespace svg {
|
|||||||
if(!uselatex)
|
if(!uselatex)
|
||||||
print(f, "font-family='", font, "' font-size='", coord(size), "' ");
|
print(f, "font-family='", font, "' font-size='", coord(size), "' ");
|
||||||
print(f,
|
print(f,
|
||||||
stylestr(col, frame ? 0x0000000FF : 0, (1<<get_sightrange())*dfc/40),
|
stylestr(col, frame ? 0x0000000FF : 0, (1<<get_sightrange())*dfc*text_width_multiplier),
|
||||||
">", str2, "</text>");
|
">", str2, "</text>");
|
||||||
stopstring();
|
stopstring();
|
||||||
println(f);
|
println(f);
|
||||||
@ -208,6 +212,12 @@ int read_args() {
|
|||||||
shot::make_svg = true;
|
shot::make_svg = true;
|
||||||
shot::take(argcs());
|
shot::take(argcs());
|
||||||
}
|
}
|
||||||
|
else if(argis("-svgtwm")) {
|
||||||
|
shift_arg_formula(svg::text_width_multiplier);
|
||||||
|
}
|
||||||
|
else if(argis("-svgmt")) {
|
||||||
|
shift(); svg::min_text = argi();
|
||||||
|
}
|
||||||
else return 1;
|
else return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user