X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fdevel-api%2Ftext-abstraction%2Ffont-client.cpp;h=5d9f1754ae7ff70abd94c95bdf5d73e316319dce;hb=e955a01e265d73072f39b87248b44701f8f4f025;hp=b19fa22afc20d980aab83ea0bf227b19246e85b2;hpb=9a9ab95ca063cc2cbfddc0d249e441f8bf7845c2;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/devel-api/text-abstraction/font-client.cpp b/dali/devel-api/text-abstraction/font-client.cpp index b19fa22..5d9f175 100644 --- a/dali/devel-api/text-abstraction/font-client.cpp +++ b/dali/devel-api/text-abstraction/font-client.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -25,6 +25,8 @@ namespace Dali { namespace TextAbstraction { +// FontClient static const value definition. + const PointSize26Dot6 FontClient::DEFAULT_POINT_SIZE = 768u; // 12*64 const float FontClient::DEFAULT_ITALIC_ANGLE = 12.f * Dali::Math::PI_OVER_180; // FreeType documentation states the software italic is done by doing a horizontal shear of 12 degrees (file ftsynth.h). @@ -48,25 +50,20 @@ const Size FontClient::MAX_SIZE_FIT_IN_ATLAS(MAX_TEXT_ATLAS_WIDTH - PADDING_TEXT const uint32_t FontClient::NUMBER_OF_POINTS_PER_ONE_UNIT_OF_POINT_SIZE = 64u; //Found this value from toolkit -FontClient::GlyphBufferData::GlyphBufferData() -: buffer{nullptr}, - width{0u}, - height{0u}, - outlineOffsetX{0}, - outlineOffsetY{0}, - format{Pixel::A8}, - isColorEmoji{false}, - isColorBitmap{false} -{ -} +// FontClient -FontClient::GlyphBufferData::~GlyphBufferData() +FontClient FontClient::Get() { + return Internal::FontClient::Get(); } -FontClient FontClient::Get() +FontClient FontClient::New(uint32_t horizontalDpi, uint32_t verticalDpi) { - return Internal::FontClient::Get(); + auto fontClientImpl = new Internal::FontClient(); + + fontClientImpl->SetDpi(horizontalDpi, verticalDpi); + + return FontClient(fontClientImpl); } FontClient::FontClient() @@ -77,16 +74,13 @@ FontClient::~FontClient() { } -FontClient::FontClient(const FontClient& handle) -: BaseHandle(handle) -{ -} +FontClient::FontClient(const FontClient& handle) = default; -FontClient& FontClient::operator=(const FontClient& handle) -{ - BaseHandle::operator=(handle); - return *this; -} +FontClient& FontClient::operator=(const FontClient& handle) = default; + +FontClient::FontClient(FontClient&& handle) = default; + +FontClient& FontClient::operator=(FontClient&& handle) = default; void FontClient::ClearCache() { @@ -118,6 +112,11 @@ void FontClient::GetDefaultFonts(FontList& defaultFonts) GetImplementation(*this).GetDefaultFonts(defaultFonts); } +void FontClient::InitDefaultFontDescription() +{ + GetImplementation(*this).InitDefaultFontDescription(); +} + void FontClient::GetDefaultPlatformFontDescription(FontDescription& fontDescription) { GetImplementation(*this).GetDefaultPlatformFontDescription(fontDescription); @@ -128,14 +127,14 @@ void FontClient::GetSystemFonts(FontList& systemFonts) GetImplementation(*this).GetSystemFonts(systemFonts); } -void FontClient::GetDescription(FontId id, FontDescription& fontDescription) +void FontClient::GetDescription(FontId fontId, FontDescription& fontDescription) { - GetImplementation(*this).GetDescription(id, fontDescription); + GetImplementation(*this).GetDescription(fontId, fontDescription); } -PointSize26Dot6 FontClient::GetPointSize(FontId id) +PointSize26Dot6 FontClient::GetPointSize(FontId fontId) { - return GetImplementation(*this).GetPointSize(id); + return GetImplementation(*this).GetPointSize(fontId); } bool FontClient::IsCharacterSupportedByFont(FontId fontId, Character character) @@ -215,6 +214,11 @@ GlyphIndex FontClient::GetGlyphIndex(FontId fontId, Character charcode) return GetImplementation(*this).GetGlyphIndex(fontId, charcode); } +GlyphIndex FontClient::GetGlyphIndex(FontId fontId, Character charcode, Character variantSelector) +{ + return GetImplementation(*this).GetGlyphIndex(fontId, charcode, variantSelector); +} + bool FontClient::GetGlyphMetrics(GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal) { return GetImplementation(*this).GetGlyphMetrics(array, size, type, horizontal); @@ -300,6 +304,16 @@ FontClient FontClientPreInitialize() return Internal::FontClient::PreInitialize(); } +void FontClientPreCache(const FontFamilyList& fallbackFamilyList, const FontFamilyList& extraFamilyList, const FontFamily& localeFamily, bool useThread) +{ + Internal::FontClient::PreCache(fallbackFamilyList, extraFamilyList, localeFamily, useThread); +} + +void FontClientFontPreLoad(const FontPathList& fontPathList, const FontPathList& memoryFontPathList, bool useThread) +{ + Internal::FontClient::PreLoad(fontPathList, memoryFontPathList, useThread); +} + } // namespace TextAbstraction } // namespace Dali