28 #ifndef YSL_INC_ADAPTOR_FONT_H_
29 #define YSL_INC_ADAPTOR_FONT_H_ 1
31 #include "../Core/yfunc.hpp"
32 #include "../Core/yobject.h"
34 #include "../Core/yexcept.h"
41 #include FT_FREETYPE_H
101 return style == FontStyle::Bold ?
"Bold" : (
style == FontStyle::Italic
102 ?
"Italic" : (
style == FontStyle::Underline ?
"Underline" : (
style
103 == FontStyle::Strikeout ?
"Strikeout" :
"Regular")));
115 typedef map<const StyleName, Typeface*>
FaceMap;
219 DefGetter(const ynothrow, ::FT_Int, CMapIndex, cmap_index)
255 CharBitmap(
const NativeType& b)
281 friend class Typeface;
289 typedef set<Typeface*, ystdex::deref_comp<const Typeface>>
318 FontCache(
size_t = DefaultGlyphCacheSize);
330 DefGetter(const ynothrow, const FamilyMap&, FamilyIndices, mFamilies) \
345 GetDefaultTypefacePtr() const
ythrow(LoggedEvent);
352 GetTypefacePtr(const
FamilyName&, const StyleName&) const;
360 GetNativeFace(Typeface*) const;
367 operator+=(FontFamily&);
373 operator+=(Typeface&);
380 operator-=(FontFamily&);
386 operator-=(Typeface&);
407 LoadTypeface(const
FontPath&,
size_t) ynothrow;
416 LoadTypefaces(const FontPath&);
423 InitializeDefaultTypeface();
429 ImplRet(FTC_Manager_Reset(manager))
442 MinimalSize = 4, MaximalSize = 96;
465 Font(
const FontFamily&,
FontSize = DefaultSize,
468 DefPred(
const ynothrow, Bold,
bool(style & FontStyle::Bold))
478 GetAdvance(
ucs4_t, FTC_SBit = {})
const;
490 GetDescender()
const;
491 DefGetterMem(
const ynothrow,
const FamilyName&, FamilyName,
494 DefGetterMem(const ynothrow, const FontFamily&, FontFamily, GetTypeface())
505 GetGlyph(
ucs4_t c, ::FT_UInt flags = FT_LOAD_RENDER | FT_LOAD_TARGET_NORMAL)
512 GetHeight() const ynothrow;
521 GetInternalInfo() const;
528 DefGetter(const ynothrow, Typeface&, Typeface,
529 *static_cast<Typeface*>(scaler.face_id))
535 SetSize(FontSize = DefaultSize);