Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
malcolmh committed Jan 18, 2015
1 parent 985e1a5 commit 21d3261
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 18 deletions.
18 changes: 10 additions & 8 deletions searender/render.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ double minlat, minlon, maxlat, maxlon, top, xmax, ymax, mile;
int zoom;
int ref = 0;

Item_t map = {{0,0,0,0,0,0,0,0,0,0}, NULL, NULL, NULL, EMPTY, 0, 0};
Item_t map = {{0,0,0,0,0,0,0,0,0,0}, NULL, NULL, NULL, NULL, NULL, EMPTY, 0};

Item_t *item = NULL;
Obja_t type = 0;
Expand All @@ -47,7 +47,7 @@ char *body_colours[] = { [COL_UNK]="#000000", [COL_WHT]="#ffffff", [COL_BLK]="#0
[COL_ORG]="orange", [COL_MAG]="#f000f0", [COL_PNK]="pink" };

char *light_colours[] = { [COL_UNK]="magenta", [COL_WHT]="#ffff00", [COL_BLK]="", [COL_RED]="#ff0000", [COL_GRN]="#00ff00", [COL_BLU]="#0000ff", [COL_YEL]="#ffff00",
[COL_GRY]="", [COL_BRN]="", [COL_AMB]="amber", [COL_VIO]="violet", [COL_ORG]="orange", [COL_MAG]="magenta", [COL_PNK]="" };
[COL_GRY]="", [COL_BRN]="", [COL_AMB]="#ffc200", [COL_VIO]="violet", [COL_ORG]="orange", [COL_MAG]="magenta", [COL_PNK]="" };

char *light_letters[] = { [COL_UNK]="", [COL_WHT]="W", [COL_BLK]="", [COL_RED]="R", [COL_GRN]="G", [COL_BLU]="Bu", [COL_YEL]="Y",
[COL_GRY]="", [COL_BRN]="", [COL_AMB]="Am", [COL_VIO]="Vi", [COL_ORG]="Or", [COL_MAG]="", [COL_PNK]="" };
Expand Down Expand Up @@ -1036,12 +1036,14 @@ int drawArea(Item_t *item, char *style) {
}

int drawLineText(Item_t *item, char *text, char *style, double offset, double dy, int path) {
printf("<text id=\"%d\" ", ++ref);
scaleStyle(style);
if (offset > 1.0)
printf("><textPath xlink:href=\"#%d\" startOffset=\"%f\"><tspan dy=\"%f\">%s</tspan></textPath></text>\n", path, offset*text[zoom], dy*symbolScale[zoom], text);
else
printf("><textPath xlink:href=\"#%d\" startOffset=\"%f%%\"><tspan dy=\"%f\">%s</tspan></textPath></text>\n", path, offset*100, dy*symbolScale[zoom], text);
if (path != 0) {
printf("<text id=\"%d\" ", ++ref);
scaleStyle(style);
if (offset > 1.0)
printf("><textPath xlink:href=\"#%d\" startOffset=\"%f\"><tspan dy=\"%f\">%s</tspan></textPath></text>\n", path, offset*text[zoom], dy*symbolScale[zoom], text);
else
printf("><textPath xlink:href=\"#%d\" startOffset=\"%f%%\"><tspan dy=\"%f\">%s</tspan></textPath></text>\n", path, offset*100, dy*symbolScale[zoom], text);
}
return ref;
}

Expand Down
4 changes: 3 additions & 1 deletion searender/rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ object_rules(separation) {

object_rules(transits) {
int ref;
if (zoom >= 12) {
if (zoom >= 14) {
if (is_type("recommended_track")) ref = line("stroke-width:8; stroke:#000000; stroke-linecap:butt; fill:none");
else if (is_type("navigation_line")) ref = line("stroke-width:8; stroke-dasharray:20,20; stroke:#000000; stroke-linecap:butt; fill:none");
}
Expand Down Expand Up @@ -481,6 +481,8 @@ object_rules(radios) {
end_switch
}
}
if ((zoom >= 15) && has_item_attribute("name"))
text(item_attribute("name"), "font-family:Arial; font-weight:bold; font-size:80; text-anchor:middle", 0, -140);
if (has_object("fog_signal")) object(fogs);
if (has_object("light")) object(lights);
}
Expand Down
2 changes: 1 addition & 1 deletion searender/searender.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ int main (int argc, const char * argv[]) {
strtok(NULL, "\"'");
key = strtok(NULL, "\"'");
strtok(NULL, "\"'");
value = strtok(NULL, "\"'");
value = strtok(NULL, "\"");
addTag(item, key, value);
if (strncmp(key, "seamark:", 8) != 0) continue;
prefix = strtok(key, ":");
Expand Down
12 changes: 4 additions & 8 deletions searender/symbols/MarineFarm.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions searender/symbols/symbols.defs
Original file line number Diff line number Diff line change
Expand Up @@ -1510,6 +1510,18 @@
<path d="m 12.779121,69.902227 -7.1907287,-7.190916 14.4116077,0 14.411607,0 -7.190728,7.190916 C 23.265978,73.857232 20.016582,77.093144 20,77.093144 c -0.01658,0 -3.265978,-3.235912 -7.220879,-7.190917 z"
style="fill-opacity:1;stroke:none" />
</symbol>
<symbol id="top_diamond3H1" width="40" height="80">
<path d="M 10,57 20,47 30,57 z"
style="fill-opacity:1;stroke:none" />
</symbol>
<symbol id="top_diamond3H2" width="40" height="80">
<path d="M 4.1,62.7 10,57 l 20,0 5.9,5.7 -5.9,5.7 -20,0 z"
style="fill-opacity:1;stroke:none" />
</symbol>
<symbol id="top_diamond3H3" width="40" height="80">
<path d="M 10,68.4 20,78 30,68.4 z"
style="fill-opacity:1;stroke:none" />
</symbol>
<symbol id="top_diamond2B1" width="40" height="80">
<path d="m 15.273439,67.330096 -4.731463,-4.631658 0.566421,-0.573437 c 0.311532,-0.315391 2.432943,-2.480218 4.714247,-4.810726 2.281304,-2.330509 4.157625,-4.241938 4.169602,-4.247622 0.0249,-0.01182 9.514049,9.568483 9.529469,9.621005 0.0056,0.01892 -1.940726,1.923125 -4.325068,4.231567 -2.384341,2.308442 -4.527897,4.387374 -4.763456,4.619848 l -0.42829,0.422681 -4.731462,-4.631658 z"
style="fill-opacity:1;stroke:none" />
Expand Down

0 comments on commit 21d3261

Please sign in to comment.