invalid fontsets added to map lead to unnecessary overhead during text rendering #1182

Closed
springmeyer opened this Issue Apr 19, 2012 · 0 comments

Projects

None yet

1 participant

@springmeyer
Member

Take a fontset like:

<FontSet name="fontset-name">
  <Font face-name="Some font not found on system"/>
  <Font face-name="Another font not found on system"/>
  <Font face-name="Yet another font not found on system"/>
  <Font face-name="DejaVu Sans Book"/>
</FontSet>

Even though the first three fonts are unable to be found on a given users system, they are still added to the map_parser::fontsets_ list:

https://github.com/mapnik/mapnik/blob/master/src/load_map.cpp#L456-474

and then passed to the text handling code at:

https://github.com/mapnik/mapnik/blob/master/src/load_map.cpp#L1095-1099

such that for every character ultimately rendered there are N (in this case three) failed attempts to pull font data from empty pointers at:

https://github.com/mapnik/mapnik/blob/master/include/mapnik/font_engine_freetype.hpp#L305-318

@springmeyer springmeyer pushed a commit that closed this issue Apr 19, 2012
Dane Springmeyer optimize font rendering with fontsets in the case of some fontset fon…
…ts not being available on the users system - closes #1182
2b92f04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment