X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=text%2Fdali%2Fdevel-api%2Ftext-abstraction%2Ffont-client.cpp;h=c823b1b41f113a159ca106f382c99de4bff302d8;hb=60e63d023d5dabea0c560dd761fd9be6de46a27e;hp=f5305effdbc61d324bed902150ce6033d0803121;hpb=f032b356d895780bc79e9281e27638d598e439b5;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/text/dali/devel-api/text-abstraction/font-client.cpp b/text/dali/devel-api/text-abstraction/font-client.cpp index f5305ef..c823b1b 100644 --- a/text/dali/devel-api/text-abstraction/font-client.cpp +++ b/text/dali/devel-api/text-abstraction/font-client.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,18 @@ namespace TextAbstraction const PointSize26Dot6 FontClient::DEFAULT_POINT_SIZE = 768u; // 12*64 +FontClient::GlyphBufferData::GlyphBufferData() +: buffer( nullptr ), + width( 0u ), + height( 0u ), + format( Pixel::A8 ) +{ +} + +FontClient::GlyphBufferData::~GlyphBufferData() +{ +} + FontClient FontClient::Get() { return Internal::FontClient::Get(); @@ -53,6 +65,11 @@ FontClient& FontClient::operator=( const FontClient& handle ) return *this; } +void FontClient::ClearCache() +{ + GetImplementation(*this).ClearCache(); +} + void FontClient::SetDpi( unsigned int horizontalDpi, unsigned int verticalDpi ) { GetImplementation(*this).SetDpi( horizontalDpi, verticalDpi ); @@ -63,9 +80,14 @@ void FontClient::GetDpi( unsigned int& horizontalDpi, unsigned int& verticalDpi GetImplementation(*this).GetDpi( horizontalDpi, verticalDpi ); } -void FontClient::SetDefaultFont( const FontDescription& fontDescription ) +int FontClient::GetDefaultFontSize() +{ + return GetImplementation(*this).GetDefaultFontSize(); +} + +void FontClient::ResetSystemDefaults() { - GetImplementation(*this).SetDefaultFont( fontDescription ); + GetImplementation(*this).ResetSystemDefaults(); } void FontClient::GetDefaultFonts( FontList& defaultFonts ) @@ -93,28 +115,45 @@ PointSize26Dot6 FontClient::GetPointSize( FontId id ) return GetImplementation(*this).GetPointSize( id ); } -FontId FontClient::FindDefaultFont( Character charcode, PointSize26Dot6 pointSize, bool preferColor ) +bool FontClient::IsCharacterSupportedByFont( FontId fontId, Character character ) +{ + return GetImplementation(*this).IsCharacterSupportedByFont( fontId, character ); +} + +FontId FontClient::FindDefaultFont( Character charcode, + PointSize26Dot6 requestedPointSize, + bool preferColor ) { - return GetImplementation(*this).FindDefaultFont( charcode, pointSize, preferColor ); + return GetImplementation(*this).FindDefaultFont( charcode, + requestedPointSize, + preferColor ); } -FontId FontClient::GetFontId( const FontPath& path, PointSize26Dot6 pointSize, FaceIndex faceIndex ) +FontId FontClient::FindFallbackFont( Character charcode, + const FontDescription& preferredFontDescription, + PointSize26Dot6 requestedPointSize, + bool preferColor ) { - return GetImplementation(*this).GetFontId( path, pointSize, faceIndex ); + return GetImplementation(*this).FindFallbackFont( charcode, preferredFontDescription, requestedPointSize, preferColor ); +} + +FontId FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex ) +{ + return GetImplementation(*this).GetFontId( path, requestedPointSize, faceIndex ); } FontId FontClient::GetFontId( const FontDescription& fontDescription, - PointSize26Dot6 pointSize, + PointSize26Dot6 requestedPointSize, FaceIndex faceIndex ) { return GetImplementation(*this).GetFontId( fontDescription, - pointSize, + requestedPointSize, faceIndex ); } bool FontClient::IsScalable( const FontPath& path ) { - return GetImplementation(*this).IsScalable( path );; + return GetImplementation(*this).IsScalable( path ); } bool FontClient::IsScalable( const FontDescription& fontDescription ) @@ -133,9 +172,9 @@ void FontClient::GetFixedSizes( const FontDescription& fontDescription, GetImplementation(*this).GetFixedSizes( fontDescription, sizes ); } -void FontClient::GetFontMetrics( FontId fontId, FontMetrics& metrics, int maxFixedSize ) +void FontClient::GetFontMetrics( FontId fontId, FontMetrics& metrics ) { - GetImplementation(*this).GetFontMetrics( fontId, metrics, maxFixedSize ); + GetImplementation(*this).GetFontMetrics( fontId, metrics ); } GlyphIndex FontClient::GetGlyphIndex( FontId fontId, Character charcode ) @@ -143,19 +182,39 @@ GlyphIndex FontClient::GetGlyphIndex( FontId fontId, Character charcode ) return GetImplementation(*this).GetGlyphIndex( fontId, charcode ); } -bool FontClient::GetGlyphMetrics( GlyphInfo* array, uint32_t size, bool horizontal, int maxFixedSize ) +bool FontClient::GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal ) +{ + return GetImplementation(*this).GetGlyphMetrics( array, size, type, horizontal ); +} + +void FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, GlyphBufferData& data, int outlineWidth ) +{ + GetImplementation(*this).CreateBitmap( fontId, glyphIndex, data, outlineWidth ); +} + +PixelData FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, int outlineWidth ) +{ + return GetImplementation(*this).CreateBitmap( fontId, glyphIndex, outlineWidth ); +} + +void FontClient::CreateVectorBlob( FontId fontId, GlyphIndex glyphIndex, VectorBlob*& blob, unsigned int& blobLength, unsigned int& nominalWidth, unsigned int& nominalHeight ) +{ + GetImplementation(*this).CreateVectorBlob( fontId, glyphIndex, blob, blobLength, nominalWidth, nominalHeight ); +} + +const GlyphInfo& FontClient::GetEllipsisGlyph( PointSize26Dot6 requestedPointSize ) { - return GetImplementation(*this).GetGlyphMetrics( array, size, horizontal, maxFixedSize ); + return GetImplementation(*this).GetEllipsisGlyph( requestedPointSize ); } -BufferImage FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex ) +bool FontClient::IsColorGlyph( FontId fontId, GlyphIndex glyphIndex ) { - return GetImplementation(*this).CreateBitmap( fontId, glyphIndex ); + return GetImplementation(*this).IsColorGlyph( fontId, glyphIndex ); } -const GlyphInfo& FontClient::GetEllipsisGlyph( PointSize26Dot6 pointSize ) +bool FontClient::AddCustomFontDirectory( const FontPath& path ) { - return GetImplementation(*this).GetEllipsisGlyph( pointSize ); + return GetImplementation(*this).AddCustomFontDirectory( path ); } FontClient::FontClient( Internal::FontClient* internal )