~ubuntu-branches/ubuntu/saucy/gnash/saucy-proposed

« back to all changes in this revision

Viewing changes to libcore/FreetypeGlyphsProvider.cpp

  • Committer: Package Import Robot
  • Author(s): Micah Gersten
  • Date: 2012-03-04 03:19:06 UTC
  • mfrom: (1.1.18) (3.1.24 sid)
  • Revision ID: package-import@ubuntu.com-20120304031906-p6q5rnb0xhgpof7o
Tags: 0.8.10-3ubuntu1
* Merge from Debian testing (FFe: LP: #940876), remaining changes:
  - Use mozilla-flashplugin as the alternative for now
  - Change xulrunner-dev build dep to firefox-dev
* Drop the plugin API porting patch, this has been fixed upstream
  - drop debian/patches*
* Drop the following change as we want Adobe's player to take priority
  if it's installed
  - Set alternative priority to 50 so that it matches Adobe Flash's priority

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// FreetypeGlyphsProvider.cpp:  Freetype glyphs manager
2
2
// 
3
 
//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010,
4
 
//   2011 Free Software Foundation, Inc
 
3
//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
 
4
//   Free Software Foundation, Inc
5
5
// 
6
6
// This program is free software; you can redistribute it and/or modify
7
7
// it under the terms of the GNU General Public License as published by
263
263
{
264
264
    const int error = FT_Done_FreeType(m_lib);
265
265
    if (error) {
266
 
        log_error(_("Can't close FreeType! Error %d"), error);
 
266
        log_error(_("Can't close FreeType! Error = %d"), error);
267
267
    }
268
268
}
269
269
 
326
326
    if ( fs ) {
327
327
#ifdef GNASH_DEBUG_DEVICEFONTS
328
328
        log_debug("Found %d fonts matching the family %s (using "
329
 
                "first)", fs->nfont, name);
 
329
                    "first)", fs->nfont, name);
330
330
#endif
331
331
 
332
332
        for (int j = 0; j < fs->nfont; j++) {
333
333
            FcChar8 *file;
334
334
            if (FcPatternGetString (fs->fonts[j], FC_FILE, 0, &file) != FcResultMatch) {
335
335
#ifdef GNASH_DEBUG_DEVICEFONTS
336
 
        log_debug("Matching font %d has unknown filename, skipping", j);
 
336
                log_debug("Matching font %d has unknown filename, skipping",
 
337
                          j);
337
338
#endif
338
339
        continue;
339
340
            }
351
352
        FcFontSetDestroy(fs);
352
353
    }
353
354
 
354
 
    log_error("No device font matches the name '%s', using hard-coded"
355
 
            " font filename", name);
 
355
    log_error(_("No device font matches the name '%s', using hard-coded"
 
356
                " font filename"), name);
356
357
    filename = DEFAULT_FONTFILE;
357
358
    return true;
358
359
#else
359
 
    log_error("Font filename matching not implemented (no fontconfig"
360
 
            " support built-in), using hard-coded font filename",
 
360
    log_error(_("Font filename matching not implemented (no fontconfig"
 
361
                " support built-in), using hard-coded font filename"),
361
362
            DEFAULT_FONTFILE);
362
363
    filename = DEFAULT_FONTFILE;
363
364
    return true;
389
390
std::auto_ptr<FreetypeGlyphsProvider>
390
391
FreetypeGlyphsProvider::createFace(const std::string&, bool, bool)
391
392
{
392
 
    log_error("Freetype not supported");
 
393
    log_error(_("Freetype not supported"));
393
394
    return std::auto_ptr<FreetypeGlyphsProvider>(NULL);
394
395
}
395
396
#endif 
465
466
    scale = (float)unitsPerEM()/_face->units_per_EM;
466
467
 
467
468
#ifdef GNASH_DEBUG_DEVICEFONTS
468
 
    log_debug("EM square for font '%s' is %d, scale is thus %g", name, _face->units_per_EM, scale);
 
469
    log_debug("EM square for font '%s' is %d, scale is this %g",
 
470
              name, _face->units_per_EM, scale);
469
471
#endif
470
472
}
471
473
#else // ndef(USE_FREETYPE)
485
487
                                                FT_LOAD_NO_SCALE);
486
488
 
487
489
    if (error) {
488
 
        log_error("Error loading freetype outline glyph for char '%c' "
489
 
                "(error: %d)", code, error);
 
490
        log_error(_("Error loading freetype outline glyph for char '%c' "
 
491
                    "(error: %d)"), code, error);
490
492
        return glyph;
491
493
    }
492
494
 
494
496
    advance = _face->glyph->metrics.horiAdvance * scale;
495
497
#ifdef GNASH_DEBUG_DEVICEFONTS 
496
498
    log_debug("Advance value for glyph '%c' is %g (horiAdvance:%ld, "
497
 
            "scale:%g)", code, advance, 
498
 
            _face->glyph->metrics.horiAdvance, scale);
 
499
                "scale:%g)", code, advance, 
 
500
              _face->glyph->metrics.horiAdvance, scale);
499
501
#endif
500
502
 
501
503
    if ( _face->glyph->format != FT_GLYPH_FORMAT_OUTLINE )
502
504
    {
503
505
        unsigned long gf = _face->glyph->format;
504
 
        log_unimpl("FT_Load_Char() returned a glyph format != "
505
 
            "FT_GLYPH_FORMAT_OUTLINE (%c%c%c%c)",
 
506
        log_unimpl(_("FT_Load_Char() returned a glyph format != "
 
507
                     "FT_GLYPH_FORMAT_OUTLINE (%c%c%c%c)"),
506
508
            static_cast<char>((gf>>24)&0xff),
507
509
            static_cast<char>((gf>>16)&0xff),
508
510
            static_cast<char>((gf>>8)&0xff),
556
558
#ifdef USE_FREETYPE 
557
559
    if (_face) {
558
560
        if (FT_Done_Face(_face) != 0) {
559
 
            log_error("Could not release FT face resources");
 
561
            log_error(_("Could not release FT face resources"));
560
562
        }
561
563
    }
562
564
#endif