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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/trunk/src/core/SkFontDescriptor.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,46 @@
     1.4 +/*
     1.5 + * Copyright 2012 Google Inc.
     1.6 + *
     1.7 + * Use of this source code is governed by a BSD-style license that can be
     1.8 + * found in the LICENSE file.
     1.9 + */
    1.10 +
    1.11 +#ifndef SkFontDescriptor_DEFINED
    1.12 +#define SkFontDescriptor_DEFINED
    1.13 +
    1.14 +#include "SkString.h"
    1.15 +#include "SkTypeface.h"
    1.16 +
    1.17 +class SkStream;
    1.18 +class SkWStream;
    1.19 +
    1.20 +class SkFontDescriptor {
    1.21 +public:
    1.22 +    SkFontDescriptor(SkTypeface::Style = SkTypeface::kNormal);
    1.23 +    SkFontDescriptor(SkStream*);
    1.24 +
    1.25 +    void serialize(SkWStream*);
    1.26 +
    1.27 +    SkTypeface::Style getStyle() { return fStyle; }
    1.28 +    void setStyle(SkTypeface::Style style) { fStyle = style; }
    1.29 +
    1.30 +    const char* getFamilyName() { return fFamilyName.c_str(); }
    1.31 +    const char* getFullName() { return fFullName.c_str(); }
    1.32 +    const char* getPostscriptName() { return fPostscriptName.c_str(); }
    1.33 +    const char* getFontFileName() { return fFontFileName.c_str(); }
    1.34 +
    1.35 +    void setFamilyName(const char* name) { fFamilyName.set(name); }
    1.36 +    void setFullName(const char* name) { fFullName.set(name); }
    1.37 +    void setPostscriptName(const char* name) { fPostscriptName.set(name); }
    1.38 +    void setFontFileName(const char* name) { fFontFileName.set(name); }
    1.39 +
    1.40 +private:
    1.41 +    SkString fFamilyName;
    1.42 +    SkString fFullName;
    1.43 +    SkString fPostscriptName;
    1.44 +    SkString fFontFileName;
    1.45 +
    1.46 +    SkTypeface::Style fStyle;
    1.47 +};
    1.48 +
    1.49 +#endif // SkFontDescriptor_DEFINED

mercurial