X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=text%2Fdali%2Fdevel-api%2Ftext-abstraction%2Ffont-client.cpp;h=d15cc57eb2e9bec1588b76aad1128d14030a3b99;hb=refs%2Fchanges%2F84%2F154784%2F1;hp=c508990a9eab03540d55788bea5157fbaf968471;hpb=f6149758d4575c6f1ab0986723fdc959dae525a2;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 c508990..d15cc57 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( NULL ), + width( 0u ), + height( 0u ), + format( Pixel::A8 ) +{ +} + +FontClient::GlyphBufferData::~GlyphBufferData() +{ +} + FontClient FontClient::Get() { return Internal::FontClient::Get(); @@ -63,6 +75,11 @@ void FontClient::GetDpi( unsigned int& horizontalDpi, unsigned int& verticalDpi GetImplementation(*this).GetDpi( horizontalDpi, verticalDpi ); } +int FontClient::GetDefaultFontSize() +{ + return GetImplementation(*this).GetDefaultFontSize(); +} + void FontClient::ResetSystemDefaults() { GetImplementation(*this).ResetSystemDefaults(); @@ -93,27 +110,39 @@ 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::FindFallbackFont( FontId preferredFont, Character charcode, PointSize26Dot6 pointSize, bool preferColor ) +FontId FontClient::FindFallbackFont( Character charcode, + const FontDescription& preferredFontDescription, + PointSize26Dot6 requestedPointSize, + bool preferColor ) { - return GetImplementation(*this).FindFallbackFont( preferredFont, charcode, pointSize, preferColor ); + return GetImplementation(*this).FindFallbackFont( charcode, preferredFontDescription, requestedPointSize, preferColor ); } -FontId FontClient::GetFontId( const FontPath& path, PointSize26Dot6 pointSize, FaceIndex faceIndex ) +FontId FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex ) { - return GetImplementation(*this).GetFontId( path, pointSize, 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 ); } @@ -138,9 +167,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 ) @@ -148,19 +177,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 char* path ) { - return GetImplementation(*this).GetEllipsisGlyph( pointSize ); + return GetImplementation(*this).AddCustomFontDirectory( path ); } FontClient::FontClient( Internal::FontClient* internal )