X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=text%2Fdali%2Finternal%2Ftext-abstraction%2Ffont-client-impl.cpp;h=4ab90bf19c13869f0d60cc6a92da8249fc7a236f;hb=bcfff8de93fcf1704dbdc01a33137afb6014f092;hp=c53b4cf4a631b5b8548ed26f6e29952371d985ac;hpb=5a9caec92927aab9cbc40f4f9b81a7fde8f612e9;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/text/dali/internal/text-abstraction/font-client-impl.cpp b/text/dali/internal/text-abstraction/font-client-impl.cpp index c53b4cf..4ab90bf 100644 --- a/text/dali/internal/text-abstraction/font-client-impl.cpp +++ b/text/dali/internal/text-abstraction/font-client-impl.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. @@ -18,6 +18,11 @@ // CLASS HEADER #include +// EXTERNAL INCLUDES +#ifndef DALI_PROFILE_UBUNTU +#include +#endif + // INTERNAL INCLUDES #include #include @@ -86,12 +91,22 @@ void FontClient::GetDpi( unsigned int& horizontalDpi, unsigned int& verticalDpi verticalDpi = mDpiVertical; } -void FontClient::SetDefaultFontFamily( const std::string& fontFamilyName, - const std::string& fontStyle ) +int FontClient::GetDefaultFontSize() +{ + int fontSize( -1 ); + +#ifndef DALI_PROFILE_UBUNTU + vconf_get_int( VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, &fontSize ); +#endif // DALI_PROFILE_UBUNTU + + return fontSize; +} + +void FontClient::ResetSystemDefaults() { CreatePlugin(); - mPlugin->SetDefaultFontFamily( fontFamilyName, fontStyle ); + mPlugin->ResetSystemDefaults(); } void FontClient::GetDefaultFonts( FontList& defaultFonts ) @@ -101,6 +116,13 @@ void FontClient::GetDefaultFonts( FontList& defaultFonts ) mPlugin->GetDefaultFonts( defaultFonts ); } +void FontClient::GetDefaultPlatformFontDescription( FontDescription& fontDescription ) +{ + CreatePlugin(); + + mPlugin->GetDefaultPlatformFontDescription( fontDescription ); +} + void FontClient::GetDescription( FontId id, FontDescription& fontDescription ) { CreatePlugin(); @@ -115,6 +137,13 @@ PointSize26Dot6 FontClient::GetPointSize( FontId id ) return mPlugin->GetPointSize( id ); } +bool FontClient::IsCharacterSupportedByFont( FontId fontId, Character character ) +{ + CreatePlugin(); + + return mPlugin->IsCharacterSupportedByFont( fontId, character ); +} + void FontClient::GetSystemFonts( FontList& systemFonts ) { CreatePlugin(); @@ -122,11 +151,28 @@ void FontClient::GetSystemFonts( FontList& systemFonts ) mPlugin->GetSystemFonts( systemFonts ); } -FontId FontClient::FindDefaultFont( Character charcode, PointSize26Dot6 pointSize, bool preferColor ) +FontId FontClient::FindDefaultFont( Character charcode, + PointSize26Dot6 requestedPointSize, + bool preferColor ) +{ + CreatePlugin(); + + return mPlugin->FindDefaultFont( charcode, + requestedPointSize, + preferColor ); +} + +FontId FontClient::FindFallbackFont( Character charcode, + const FontDescription& preferredFontDescription, + PointSize26Dot6 requestedPointSize, + bool preferColor ) { CreatePlugin(); - return mPlugin->FindDefaultFont( charcode, pointSize, preferColor ); + return mPlugin->FindFallbackFont( charcode, + preferredFontDescription, + requestedPointSize, + preferColor ); } bool FontClient::IsScalable( const FontPath& path ) @@ -136,11 +182,11 @@ bool FontClient::IsScalable( const FontPath& path ) return mPlugin->IsScalable( path ); } -bool FontClient::IsScalable( const FontFamily& fontFamily, const FontStyle& style ) +bool FontClient::IsScalable( const FontDescription& fontDescription ) { CreatePlugin(); - return mPlugin->IsScalable( fontFamily, style ); + return mPlugin->IsScalable( fontDescription ); } void FontClient::GetFixedSizes( const FontPath& path, Dali::Vector< PointSize26Dot6>& sizes ) @@ -150,40 +196,40 @@ void FontClient::GetFixedSizes( const FontPath& path, Dali::Vector< PointSize26D mPlugin->GetFixedSizes( path, sizes ); } -void FontClient::GetFixedSizes( const FontFamily& fontFamily, - const FontStyle& style, +void FontClient::GetFixedSizes( const FontDescription& fontDescription, Dali::Vector< PointSize26Dot6 >& sizes ) { CreatePlugin(); - mPlugin->GetFixedSizes( fontFamily, style, sizes ); + mPlugin->GetFixedSizes( fontDescription, sizes ); } -FontId FontClient::GetFontId( const FontPath& path, PointSize26Dot6 pointSize, FaceIndex faceIndex ) +FontId FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex ) { CreatePlugin(); - return mPlugin->GetFontId( path, pointSize, faceIndex ); + return mPlugin->GetFontId( path, + requestedPointSize, + faceIndex, + true ); } -FontId FontClient::GetFontId( const FontFamily& fontFamily, - const FontStyle& fontStyle, - PointSize26Dot6 pointSize, +FontId FontClient::GetFontId( const FontDescription& fontDescription, + PointSize26Dot6 requestedPointSize, FaceIndex faceIndex ) { CreatePlugin(); - return mPlugin->GetFontId( fontFamily, - fontStyle, - pointSize, + return mPlugin->GetFontId( fontDescription, + requestedPointSize, faceIndex ); } -void FontClient::GetFontMetrics( FontId fontId, FontMetrics& metrics, int maxFixedSize ) +void FontClient::GetFontMetrics( FontId fontId, FontMetrics& metrics ) { CreatePlugin(); - return mPlugin->GetFontMetrics( fontId, metrics, maxFixedSize ); + return mPlugin->GetFontMetrics( fontId, metrics ); } GlyphIndex FontClient::GetGlyphIndex( FontId fontId, Character charcode ) @@ -193,25 +239,46 @@ GlyphIndex FontClient::GetGlyphIndex( FontId fontId, Character charcode ) return mPlugin->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 ) +{ + CreatePlugin(); + + return mPlugin->GetGlyphMetrics( array, size, type, horizontal ); +} + +void FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data, int outlineWidth ) +{ + CreatePlugin(); + + mPlugin->CreateBitmap( fontId, glyphIndex, data, outlineWidth ); +} + +PixelData FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, int outlineWidth ) +{ + CreatePlugin(); + + return mPlugin->CreateBitmap( fontId, glyphIndex, outlineWidth ); +} + +void FontClient::CreateVectorBlob( FontId fontId, GlyphIndex glyphIndex, VectorBlob*& blob, unsigned int& blobLength, unsigned int& nominalWidth, unsigned int& nominalHeight ) { CreatePlugin(); - return mPlugin->GetGlyphMetrics( array, size, horizontal, maxFixedSize ); + return mPlugin->CreateVectorBlob( fontId, glyphIndex, blob, blobLength, nominalWidth, nominalHeight ); } -BufferImage FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex ) +const GlyphInfo& FontClient::GetEllipsisGlyph( PointSize26Dot6 requestedPointSize ) { CreatePlugin(); - return mPlugin->CreateBitmap( fontId, glyphIndex ); + return mPlugin->GetEllipsisGlyph( requestedPointSize ); } -const GlyphInfo& FontClient::GetEllipsisGlyph( PointSize26Dot6 pointSize ) +bool FontClient::IsColorGlyph( FontId fontId, GlyphIndex glyphIndex ) { CreatePlugin(); - return mPlugin->GetEllipsisGlyph( pointSize ); + return mPlugin->IsColorGlyph( fontId, glyphIndex ); } void FontClient::CreatePlugin()