gfx/skia/trunk/src/core/SkFontDescriptor.h

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 /*
     2  * Copyright 2012 Google Inc.
     3  *
     4  * Use of this source code is governed by a BSD-style license that can be
     5  * found in the LICENSE file.
     6  */
     8 #ifndef SkFontDescriptor_DEFINED
     9 #define SkFontDescriptor_DEFINED
    11 #include "SkString.h"
    12 #include "SkTypeface.h"
    14 class SkStream;
    15 class SkWStream;
    17 class SkFontDescriptor {
    18 public:
    19     SkFontDescriptor(SkTypeface::Style = SkTypeface::kNormal);
    20     SkFontDescriptor(SkStream*);
    22     void serialize(SkWStream*);
    24     SkTypeface::Style getStyle() { return fStyle; }
    25     void setStyle(SkTypeface::Style style) { fStyle = style; }
    27     const char* getFamilyName() { return fFamilyName.c_str(); }
    28     const char* getFullName() { return fFullName.c_str(); }
    29     const char* getPostscriptName() { return fPostscriptName.c_str(); }
    30     const char* getFontFileName() { return fFontFileName.c_str(); }
    32     void setFamilyName(const char* name) { fFamilyName.set(name); }
    33     void setFullName(const char* name) { fFullName.set(name); }
    34     void setPostscriptName(const char* name) { fPostscriptName.set(name); }
    35     void setFontFileName(const char* name) { fFontFileName.set(name); }
    37 private:
    38     SkString fFamilyName;
    39     SkString fFullName;
    40     SkString fPostscriptName;
    41     SkString fFontFileName;
    43     SkTypeface::Style fStyle;
    44 };
    46 #endif // SkFontDescriptor_DEFINED

mercurial