~widelands-dev/widelands/localizeable_shipnames

« back to all changes in this revision

Viewing changes to src/graphic/font_handler.cc

  • Committer: GunChleoc
  • Date: 2017-04-22 08:40:21 UTC
  • mfrom: (8298.1.40 trunk)
  • Revision ID: fios@foramnagaidhlig.net-20170422084021-4u3vp59d9jkdfx63
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
#include "base/log.h"
32
32
#include "base/wexception.h"
 
33
#include "graphic/font.h"
33
34
#include "graphic/font_handler1.h"  // We need the fontset for the BiDi algorithm
34
35
#include "graphic/graphic.h"
35
36
#include "graphic/rendertarget.h"
36
37
#include "graphic/text/bidi.h"
 
38
#include "graphic/text_layout.h"
37
39
#include "graphic/texture.h"
38
40
#include "graphic/wordwrap.h"
39
41
 
212
214
        const LineCacheEntry& lce = d->get_line(style, copytext);
213
215
 
214
216
        Vector2f dstpoint = dstpoint_i.cast<float>();
215
 
        UI::correct_for_align(align, lce.width + 2 * LINE_MARGIN, lce.height, &dstpoint);
 
217
        UI::correct_for_align(align, lce.width + 2 * LINE_MARGIN, &dstpoint);
216
218
 
217
219
        if (lce.image)
218
220
                dst.blit(Vector2f(dstpoint.x + LINE_MARGIN, dstpoint.y), lce.image.get());
243
245
 */
244
246
void FontHandler::get_size(
245
247
   const TextStyle& textstyle, const std::string& text, uint32_t& w, uint32_t& h, uint32_t wrap) {
246
 
        WordWrap ww(textstyle, wrap);
 
248
        WordWrap ww(textstyle.font->size(), textstyle.fg, wrap);
247
249
        ww.wrap(text);
248
250
        w = ww.width();
249
251
        h = ww.height();