$(adaptor_common_dir)/style-monitor-impl.cpp \
$(adaptor_common_dir)/trigger-event.cpp \
$(adaptor_common_dir)/trigger-event-factory.cpp \
- $(adaptor_common_dir)/watch-application-impl.cpp \
- $(adaptor_common_dir)/watch-time.cpp \
$(adaptor_common_dir)/key-impl.cpp \
$(adaptor_common_dir)/video-player-impl.cpp \
$(adaptor_common_dir)/events/gesture-manager.cpp \
// EXTERNAL INCLUDES
#include <string>
#include <dali/public-api/signals/callback.h>
-#include <watch-application.h>
+#ifdef APPCORE_WATCH_AVAILABLE
+#include "wearable/watch/watch-application.h"
+#endif
// INTERNAL INCLUDES
#include <abort-handler.h>
*/
virtual void OnAppControl(void *) {}
+#ifdef APPCORE_WATCH_AVAILABLE
/**
* Invoked at every second
*/
* Invoked when the device enters or exits ambient mode
*/
virtual void OnAmbientChanged(bool ambient) {}
+#endif
/**
* Invoked when the language of the device is changed.
emscripten::val mCallback;
unsigned int mId;
- bool OnTouched(Dali::Actor actor, const Dali::TouchEvent& event)
+ bool OnTouched(Dali::Actor actor, const Dali::TouchData& touch)
{
Dali::Property::Map map;
Dali::Property::Array points;
- map["pointCount"] = static_cast<int>(event.GetPointCount());
- map["time"] = static_cast<int>(event.time);
+ const int pointCount = static_cast<int>( touch.GetPointCount() );
- for(TouchPointContainer::const_iterator iter = event.points.begin();
- iter != event.points.end(); ++iter) {
- const Dali::TouchPoint& pt = *iter;
+ map["pointCount"] = pointCount;
+ map["time"] = static_cast<int>( touch.GetTime() );
+
+ for( int i = 0; i < pointCount; ++i )
+ {
Dali::Property::Map pointMap;
- pointMap["deviceId"] = pt.deviceId;
- pointMap["hitActorId"] = static_cast<int>(pt.hitActor.GetId());
- pointMap["local"] = pt.local;
- pointMap["screen"]= pt.screen;
+ Dali::Actor hitActor = touch.GetHitActor( i );
- switch(pt.state)
+ pointMap["deviceId"] = touch.GetDeviceId( i );
+ pointMap["hitActorId"] = static_cast<int>( hitActor ? hitActor.GetId() : -1 );
+ pointMap["local"] = touch.GetLocalPosition( i );
+ pointMap["screen"]= touch.GetScreenPosition( i );
+
+ switch( touch.GetState( i ) )
{
- case TouchPoint::Down: { pointMap["state"] = "Down"; break; }
- case TouchPoint::Up: { pointMap["state"] = "Up"; break; }
- case TouchPoint::Motion: { pointMap["state"] = "Motion"; break; }
- case TouchPoint::Leave: { pointMap["state"] = "Leave"; break; }
- case TouchPoint::Stationary: { pointMap["state"] = "Stationary"; break; }
- case TouchPoint::Interrupted: { pointMap["state"] = "Interrupted"; break; }
- case TouchPoint::Last: { pointMap["state"] = "Last"; break; }
+ case PointState::DOWN: { pointMap["state"] = "DOWN"; break; }
+ case PointState::UP: { pointMap["state"] = "UP"; break; }
+ case PointState::MOTION: { pointMap["state"] = "MOTION"; break; }
+ case PointState::LEAVE: { pointMap["state"] = "LEAVE"; break; }
+ case PointState::STATIONARY: { pointMap["state"] = "STATIONARY"; break; }
+ case PointState::INTERRUPTED: { pointMap["state"] = "INTERRUPTED"; break; }
};
points.PushBack(pointMap);
if(0 == signalName.compare("touched"))
{
EmscriptenTouchedSignal* slot = new EmscriptenTouchedSignal(javascriptFunction, actor.GetId());
- actor.TouchedSignal().Connect(slot, &EmscriptenTouchedSignal::OnTouched);
+ actor.TouchSignal().Connect(slot, &EmscriptenTouchedSignal::OnTouched);
signalHolder.add(slot);
ret = true;
}
const unsigned int ADAPTOR_MAJOR_VERSION = 1;
const unsigned int ADAPTOR_MINOR_VERSION = 1;
-const unsigned int ADAPTOR_MICRO_VERSION = 41;
+const unsigned int ADAPTOR_MICRO_VERSION = 42;
const char * const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
#include <dali/public-api/adaptor-framework/timer.h>
#include <dali/public-api/adaptor-framework/tts-player.h>
#include <dali/public-api/adaptor-framework/native-image-source.h>
-#include <dali/public-api/adaptor-framework/watch-application.h>
#include <dali/public-api/dali-adaptor-version.h>
#endif //__DALI_H__
$(adaptor_public_api_dir)/adaptor-framework/timer.cpp \
$(adaptor_public_api_dir)/adaptor-framework/tts-player.cpp \
$(adaptor_public_api_dir)/adaptor-framework/native-image-source.cpp \
- $(adaptor_public_api_dir)/adaptor-framework/watch-application.cpp \
$(adaptor_public_api_dir)/dali-adaptor-version.cpp
$(adaptor_public_api_dir)/adaptor-framework/timer.h \
$(adaptor_public_api_dir)/adaptor-framework/tts-player.h \
$(adaptor_public_api_dir)/adaptor-framework/native-image-source.h \
- $(adaptor_public_api_dir)/adaptor-framework/window.h \
- $(adaptor_public_api_dir)/adaptor-framework/watch-application.h \
- $(adaptor_public_api_dir)/adaptor-framework/watch-time.h
+ $(adaptor_public_api_dir)/adaptor-framework/window.h
adaptor_dali_header_file = \
$(adaptor_public_api_dir)/dali.h
// INTERNAL INCLUDES
#include <callback-manager.h>
-#include <watch-application-impl.h>
-#include <watch-time.h>
namespace Dali
{
--- /dev/null
+#ifndef __DALI_WEARABLE_H__
+#define __DALI_WEARABLE_H__
+
+/*
+ * Copyright (c) 2016 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/watch/watch-application.h>
+
+#endif // __DALI_WEARABLE_H__
\ No newline at end of file
--- /dev/null
+# wearable profile public files
+
+adaptor_internal_wearable_profile_src_files = \
+ $(adaptor_wearable_dir)/watch-application-impl.cpp \
+ $(adaptor_wearable_dir)/watch/watch-application.cpp \
+ $(adaptor_wearable_dir)/watch/watch-time.cpp
+
+adaptor_dali_wearable_header_file = \
+ $(adaptor_wearable_dir)/dali-wearable.h
+
+public_dali_watch_header_files = \
+ $(adaptor_wearable_dir)/watch/watch-application.h \
+ $(adaptor_wearable_dir)/watch/watch-time.h
*/
// INTERNAL INCLUDES
-#include <watch-application.h>
+#include <wearable/watch/watch-application.h>
#include <application-impl.h>
namespace Dali
*/
// CLASS HEADER
-#include <watch-application.h>
+#include "watch-application.h"
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
-#include <watch-application-impl.h>
+#include <wearable/watch-application-impl.h>
namespace Dali
{
#include <dali/public-api/signals/callback.h>
// INTERNAL INCLUDES
-#include "application.h"
+#include <public-api/adaptor-framework/application.h>
#include "watch-time.h"
namespace Dali
*/
// CLASS HEADER
-#include <watch-time.h>
+#include <wearable/watch/watch-time.h>
// EXTERNAL INCLUDES
#ifdef APPCORE_WATCH_AVAILABLE
Integration::TouchEventCombiner::EventDispatchType type = mCombiner.GetNextTouchEvent(point, timeStamp, touchEvent, hoverEvent);
if(type != Integration::TouchEventCombiner::DispatchNone )
{
- DALI_LOG_INFO(gTouchEventLogFilter, Debug::General, "%d: Device %d: Button state %d (%.2f, %.2f)\n", timeStamp, point.deviceId, point.state, point.local.x, point.local.y);
+ DALI_LOG_INFO(gTouchEventLogFilter, Debug::General, "%d: Device %d: Button state %d (%.2f, %.2f)\n", timeStamp, point.GetDeviceId(), point.GetState(), point.GetLocalPosition().x, point.GetLocalPosition().y);
// First the touch and/or hover event & related gesture events are queued
if(type == Integration::TouchEventCombiner::DispatchTouch || type == Integration::TouchEventCombiner::DispatchBoth)
utc-Dali-Application.cpp
utc-Dali-FileLoader.cpp
utc-Dali-BitmapLoader.cpp
- utc-Dali-Watch.cpp
+ #utc-Dali-Watch.cpp
#utc-Dali-KeyGrab.cpp
)
adaptor_mobile_dir = ../../../adaptors/mobile
include ../../../adaptors/mobile/file.list
+# WEARABLE
+if WEARABLE_PROFILE
+adaptor_wearable_dir = ../../../adaptors/wearable
+include ../../../adaptors/wearable/file.list
+endif
+
# TV
if TV_PROFILE
adaptor_tv_dir = ../../../adaptors/tv
endif # USE_ECORE_WAYLAND
adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files) \
- $(adaptor_tizen_internal_native_image_src_files)
+ $(adaptor_tizen_internal_native_image_src_files) \
+ $(adaptor_internal_wearable_profile_src_files)
else
adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) \
$(adaptor_common_internal_egl_extension_src_files)
tizenadaptordaliheaderdir = $(devincludepath)/dali
tizenadaptordaliheader_HEADERS = $(adaptor_dali_header_file)
+if WEARABLE_PROFILE
+tizenadaptorpublicapi_HEADERS += $(adaptor_dali_wearable_header_file)
+
+tizenwatchpublicapidir = $(tizenadaptorpublicapidir)/watch
+tizenwatchpublicapi_HEADERS = $(public_dali_watch_header_files)
+endif
+
install-data-local:
$(MKDIR_P) ${DESTDIR}/${daliUserFontCacheDir} ${DESTDIR}/${daliShaderbinCacheDir}
Name: dali-adaptor
Summary: The DALi Tizen Adaptor
-Version: 1.1.41
+Version: 1.1.42
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-2-Clause and MIT
return GetImplementation(*this).GetPointSize( id );
}
-FontId FontClient::FindDefaultFont( Character charcode, PointSize26Dot6 pointSize, bool preferColor )
+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( FontId preferredFont, Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor )
{
- return GetImplementation(*this).FindFallbackFont( preferredFont, charcode, pointSize, preferColor );
+ return GetImplementation(*this).FindFallbackFont( preferredFont, charcode, 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 );
}
GetImplementation(*this).GetFixedSizes( fontDescription, sizes );
}
-void FontClient::GetFontMetrics( FontId fontId, FontMetrics& metrics, int desiredFixedSize )
+void FontClient::GetFontMetrics( FontId fontId, FontMetrics& metrics )
{
- GetImplementation(*this).GetFontMetrics( fontId, metrics, desiredFixedSize );
+ GetImplementation(*this).GetFontMetrics( fontId, metrics );
}
GlyphIndex FontClient::GetGlyphIndex( FontId fontId, Character charcode )
return GetImplementation(*this).GetGlyphIndex( fontId, charcode );
}
-bool FontClient::GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal, int desiredFixedSize )
+bool FontClient::GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal )
{
- return GetImplementation(*this).GetGlyphMetrics( array, size, type, horizontal, desiredFixedSize );
+ return GetImplementation(*this).GetGlyphMetrics( array, size, type, horizontal );
}
BufferImage FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex )
GetImplementation(*this).CreateVectorBlob( fontId, glyphIndex, blob, blobLength, nominalWidth, nominalHeight );
}
-const GlyphInfo& FontClient::GetEllipsisGlyph( PointSize26Dot6 pointSize )
+const GlyphInfo& FontClient::GetEllipsisGlyph( PointSize26Dot6 requestedPointSize )
{
- return GetImplementation(*this).GetEllipsisGlyph( pointSize );
+ return GetImplementation(*this).GetEllipsisGlyph( requestedPointSize );
}
FontClient::FontClient( Internal::FontClient* internal )
* This is useful when localised strings are provided for multiple languages
* i.e. when a single default font does not work for all languages.
* @param[in] charcode The character for which a font is needed.
- * @param[in] pointSize The point size in 26.6 fractional points; the default point size is 12*64.
+ * @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
* @param[in] preferColor True if a color font is preferred.
* @return A valid font ID, or zero if the font does not exist.
*/
FontId FindDefaultFont( Character charcode,
- PointSize26Dot6 pointSize = DEFAULT_POINT_SIZE,
+ PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
bool preferColor = false );
/**
* @param[in] preferredFont The preferred font which may not provide a glyph for charcode.
* The fallback-font will be the closest match to preferredFont, which does support the required glyph.
* @param[in] charcode The character for which a font is needed.
- * @param[in] pointSize The point size in 26.6 fractional points; the default point size is 12*64.
+ * @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
* @param[in] preferColor True if a color font is preferred.
* @return A valid font ID, or zero if the font does not exist.
*/
FontId FindFallbackFont( FontId preferredFont,
Character charcode,
- PointSize26Dot6 pointSize = DEFAULT_POINT_SIZE,
+ PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
bool preferColor = false );
/**
* @brief Retrieve the unique identifier for a font.
*
* @param[in] path The path to a font file.
- * @param[in] pointSize The point size in 26.6 fractional points; the default point size is 12*64.
+ * @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
* @param[in] faceIndex The index of the font face (optional).
* @return A valid font ID, or zero if the font does not exist.
*/
FontId GetFontId( const FontPath& path,
- PointSize26Dot6 pointSize = DEFAULT_POINT_SIZE,
+ PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
FaceIndex faceIndex = 0 );
/**
* @note It the font style is not empty, it will be used instead the font weight and font slant slant.
*
* @param[in] fontDescription A font description.
- * @param[in] pointSize The point size in 26.6 fractional points; the default point size is 12*64.
+ * @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
* @param[in] faceIndex The index of the font face (optional).
* @return A valid font ID, or zero if the font does not exist.
*/
FontId GetFontId( const FontDescription& fontDescription,
- PointSize26Dot6 pointSize = DEFAULT_POINT_SIZE,
+ PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
FaceIndex faceIndex = 0 );
/**
*
* @param[in] fontId The ID of the font for the required glyph.
* @param[out] metrics The font metrics.
- * @param[in] desiredFixedSize The metrics for fixed-size fonts will be scaled to this desired size (in pixels).
*/
- void GetFontMetrics( FontId fontId, FontMetrics& metrics, int desiredFixedSize = 0 );
+ void GetFontMetrics( FontId fontId, FontMetrics& metrics );
/**
* @brief Retrieve the glyph index for a UTF-32 character code.
* @param[in] size The size of the array.
* @param[in] type The type of glyphs used for rendering; either bitmaps or vectors.
* @param[in] horizontal True for horizontal layouts (set to false for vertical layouting).
- * @param[in] desiredFixedSize The metrics for fixed-size fonts will be scaled to this desired size (in pixels).
* @return True if all of the requested metrics were found.
*/
- bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal = true, int desiredFixedSize = 0 );
+ bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal = true );
/**
* @brief Create a bitmap representation of a glyph.
/**
* @brief Retrieves the ellipsis glyph for a requested point size.
*
- * @param[in] pointSize The requested point size.
+ * @param[in] requestedPointSize The requested point size.
*
* @return The ellipsis glyph.
*/
- const GlyphInfo& GetEllipsisGlyph( PointSize26Dot6 pointSize );
+ const GlyphInfo& GetEllipsisGlyph( PointSize26Dot6 requestedPointSize );
public: // Not intended for application developers
/**
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, pointSize, preferColor );
+ return mPlugin->FindDefaultFont( charcode, requestedPointSize, preferColor );
}
-FontId FontClient::FindFallbackFont( FontId preferredFont, Character charcode, PointSize26Dot6 pointSize, bool preferColor )
+FontId FontClient::FindFallbackFont( FontId preferredFont, Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor )
{
CreatePlugin();
- return mPlugin->FindFallbackFont( preferredFont, charcode, pointSize, preferColor );
+ return mPlugin->FindFallbackFont( preferredFont, charcode, requestedPointSize, preferColor );
}
bool FontClient::IsScalable( const FontPath& path )
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,
+ requestedPointSize,
+ faceIndex );
}
FontId FontClient::GetFontId( const FontDescription& fontDescription,
- PointSize26Dot6 pointSize,
+ PointSize26Dot6 requestedPointSize,
FaceIndex faceIndex )
{
CreatePlugin();
return mPlugin->GetFontId( fontDescription,
- pointSize,
+ requestedPointSize,
+ requestedPointSize,
faceIndex );
}
-void FontClient::GetFontMetrics( FontId fontId, FontMetrics& metrics, int desiredFixedSize )
+void FontClient::GetFontMetrics( FontId fontId, FontMetrics& metrics )
{
CreatePlugin();
- return mPlugin->GetFontMetrics( fontId, metrics, desiredFixedSize );
+ return mPlugin->GetFontMetrics( fontId, metrics );
}
GlyphIndex FontClient::GetGlyphIndex( FontId fontId, Character charcode )
return mPlugin->GetGlyphIndex( fontId, charcode );
}
-bool FontClient::GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal, int desiredFixedSize )
+bool FontClient::GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal )
{
CreatePlugin();
- return mPlugin->GetGlyphMetrics( array, size, type, horizontal, desiredFixedSize );
+ return mPlugin->GetGlyphMetrics( array, size, type, horizontal );
}
BufferImage FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex )
return mPlugin->CreateVectorBlob( fontId, glyphIndex, blob, blobLength, nominalWidth, nominalHeight );
}
-const GlyphInfo& FontClient::GetEllipsisGlyph( PointSize26Dot6 pointSize )
+const GlyphInfo& FontClient::GetEllipsisGlyph( PointSize26Dot6 requestedPointSize )
{
CreatePlugin();
- return mPlugin->GetEllipsisGlyph( pointSize );
+ return mPlugin->GetEllipsisGlyph( requestedPointSize );
}
void FontClient::CreatePlugin()
/**
* @copydoc Dali::FontClient::FindDefaultFont()
*/
- FontId FindDefaultFont( Character charcode, PointSize26Dot6 pointSize, bool preferColor );
+ FontId FindDefaultFont( Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor );
/**
* @copydoc Dali::FontClient::FindFallbackFont()
*/
- FontId FindFallbackFont( FontId preferredFont, Character charcode, PointSize26Dot6 pointSize, bool preferColor );
+ FontId FindFallbackFont( FontId preferredFont, Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor );
/**
- * @copydoc Dali::FontClient::GetFontId( const FontPath& path, PointSize26Dot6 pointSize, FaceIndex faceIndex )
+ * @copydoc Dali::FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
*/
- FontId GetFontId( const FontPath& path, PointSize26Dot6 pointSize, FaceIndex faceIndex );
+ FontId GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex );
/**
- * @copydoc Dali::FontClient::GetFontId( const FontDescription& fontDescription, PointSize26Dot6 pointSize, FaceIndex faceIndex )
+ * @copydoc Dali::FontClient::GetFontId( const FontDescription& fontDescription, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
*/
FontId GetFontId( const FontDescription& fontDescription,
- PointSize26Dot6 pointSize,
+ PointSize26Dot6 requestedPointSize,
FaceIndex faceIndex );
/**
/**
* @copydoc Dali::FontClient::GetFontMetrics()
*/
- void GetFontMetrics( FontId fontId, FontMetrics& metrics, int desiredFixedSize );
+ void GetFontMetrics( FontId fontId, FontMetrics& metrics );
/**
* @copydoc Dali::FontClient::GetGlyphIndex()
/**
* @copydoc Dali::FontClient::GetGlyphMetrics()
*/
- bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal, int desiredFixedSize );
+ bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal );
/**
* @copydoc Dali::FontClient::CreateBitmap()
/**
* @copydoc Dali::FontClient::GetEllipsisGlyph()
*/
- const GlyphInfo& GetEllipsisGlyph( PointSize26Dot6 pointSize );
+ const GlyphInfo& GetEllipsisGlyph( PointSize26Dot6 requestedPointSize );
private:
* Conversion from Fractional26.6 to float
*/
const float FROM_266 = 1.0f / 64.0f;
+const float POINTS_PER_INCH = 72.f;
const std::string FONT_FORMAT( "TrueType" );
const std::string DEFAULT_FONT_FAMILY_NAME( "Tizen" );
}
FontClient::Plugin::FontIdCacheItem::FontIdCacheItem( FontDescriptionId validatedFontId,
- PointSize26Dot6 pointSize,
+ PointSize26Dot6 requestedPointSize,
FontId fontId )
: validatedFontId( validatedFontId ),
- pointSize( pointSize ),
+ requestedPointSize( requestedPointSize ),
fontId( fontId )
{
}
FontClient::Plugin::CacheItem::CacheItem( FT_Face ftFace,
const FontPath& path,
- PointSize26Dot6 pointSize,
+ PointSize26Dot6 requestedPointSize,
FaceIndex face,
const FontMetrics& metrics )
: mFreeTypeFace( ftFace ),
mPath( path ),
- mPointSize( pointSize ),
+ mRequestedPointSize( requestedPointSize ),
mFaceIndex( face ),
mMetrics( metrics ),
mFixedWidthPixels( 0.0f ),
FontClient::Plugin::CacheItem::CacheItem( FT_Face ftFace,
const FontPath& path,
- PointSize26Dot6 pointSize,
+ PointSize26Dot6 requestedPointSize,
FaceIndex face,
const FontMetrics& metrics,
float fixedWidth,
float fixedHeight )
: mFreeTypeFace( ftFace ),
mPath( path ),
- mPointSize( pointSize ),
+ mRequestedPointSize( requestedPointSize ),
mFaceIndex( face ),
mMetrics( metrics ),
mFixedWidthPixels( fixedWidth ),
if( id > 0u &&
index < mFontCache.size() )
{
- return ( *( mFontCache.begin() + index ) ).mPointSize;
+ return ( *( mFontCache.begin() + index ) ).mRequestedPointSize;
}
else
{
FontId FontClient::Plugin::FindFontForCharacter( const FontList& fontList,
Character charcode,
- PointSize26Dot6 requestedSize,
+ PointSize26Dot6 requestedPointSize,
bool preferColor )
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "FontClient::Plugin::FindFontForCharacter\n");
GetFixedSizes( description,
fixedSizes );
+ PointSize26Dot6 actualPointSize = requestedPointSize;
+
const Vector< PointSize26Dot6 >::SizeType count = fixedSizes.Count();
+
if( 0 != count )
{
- // If the font is not scalable, pick the largest size <= requestedSize
- PointSize26Dot6 size = fixedSizes[0];
+ // If the font is not scalable, pick the largest size <= requestedPointSize
+ actualPointSize = fixedSizes[0];
for( unsigned int i=1; i<count; ++i )
{
- if( fixedSizes[i] <= requestedSize &&
- fixedSizes[i] > size )
+ if( fixedSizes[i] <= requestedPointSize &&
+ fixedSizes[i] > actualPointSize )
{
- size = fixedSizes[i];
+ actualPointSize = fixedSizes[i];
}
}
- requestedSize = size;
}
fontId = GetFontId( description,
- requestedSize,
+ requestedPointSize,
+ actualPointSize,
0u );
if( preferColor )
}
FontId FontClient::Plugin::FindDefaultFont( Character charcode,
- PointSize26Dot6 requestedSize,
+ PointSize26Dot6 requestedPointSize,
bool preferColor )
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "FontClient::Plugin::FindDefaultFont DefaultFontsList(%s)\n", (mDefaultFonts.empty()?"empty":"created") );
// Traverse the list of default fonts.
// Check for each default font if supports the character.
- fontId = FindFontForCharacter( mDefaultFonts, charcode, requestedSize, preferColor );
+ fontId = FindFontForCharacter( mDefaultFonts, charcode, requestedPointSize, preferColor );
return fontId;
}
FontId FontClient::Plugin::FindFallbackFont( FontId preferredFont,
Character charcode,
- PointSize26Dot6 requestedSize,
+ PointSize26Dot6 requestedPointSize,
bool preferColor )
{
// The font id to be returned.
if( fontList )
{
- fontId = FindFontForCharacter( *fontList, charcode, requestedSize, preferColor );
+ fontId = FindFontForCharacter( *fontList, charcode, requestedPointSize, preferColor );
}
return fontId;
}
FontId FontClient::Plugin::GetFontId( const FontPath& path,
- PointSize26Dot6 pointSize,
+ PointSize26Dot6 requestedPointSize,
+ PointSize26Dot6 actualPointSize,
FaceIndex faceIndex,
bool cacheDescription )
{
if( NULL != mFreeTypeLibrary )
{
FontId foundId(0);
- if( FindFont( path, pointSize, faceIndex, foundId ) )
+ if( FindFont( path, requestedPointSize, faceIndex, foundId ) )
{
id = foundId;
}
else
{
- id = CreateFont( path, pointSize, faceIndex, cacheDescription );
+ id = CreateFont( path, requestedPointSize, actualPointSize, faceIndex, cacheDescription );
}
}
}
FontId FontClient::Plugin::GetFontId( const FontDescription& fontDescription,
- PointSize26Dot6 pointSize,
+ PointSize26Dot6 requestedPointSize,
+ PointSize26Dot6 actualPointSize,
FaceIndex faceIndex )
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "FontClient::Plugin::GetFontId font family(%s)\n", fontDescription.family.c_str() );
validatedFontId );
}
- // Check if exists a pair 'validatedFontId, pointSize' in the cache.
- if( !FindFont( validatedFontId, pointSize, fontId ) )
+ // Check if exists a pair 'validatedFontId, requestedPointSize' in the cache.
+ if( !FindFont( validatedFontId, requestedPointSize, fontId ) )
{
// Retrieve the font file name path.
const FontDescription& description = *( mFontDescriptionCache.begin() + validatedFontId );
// Retrieve the font id. Do not cache the description as it has been already cached.
fontId = GetFontId( description.path,
- pointSize,
+ requestedPointSize,
+ actualPointSize,
faceIndex,
false );
- // Cache the pair 'validatedFontId, pointSize' to improve the following queries.
+ // Cache the pair 'validatedFontId, requestedPointSize' to improve the following queries.
mFontIdCache.push_back( FontIdCacheItem( validatedFontId,
- pointSize,
+ requestedPointSize,
fontId ) );
}
}
void FontClient::Plugin::GetFontMetrics( FontId fontId,
- FontMetrics& metrics,
- int desiredFixedSize )
+ FontMetrics& metrics )
{
- if( fontId > 0 &&
- fontId-1 < mFontCache.size() )
+ if( ( fontId > 0 ) &&
+ ( fontId - 1u < mFontCache.size() ) )
{
const CacheItem& font = mFontCache[fontId-1];
metrics = font.mMetrics;
// Adjust the metrics if the fixed-size font should be down-scaled
- if( font.mIsFixedSizeBitmap &&
- ( desiredFixedSize > 0 ) )
+ if( font.mIsFixedSizeBitmap )
{
- float scaleFactor = static_cast<float>(desiredFixedSize) / static_cast<float>(font.mFixedHeightPixels);
+ const float desiredFixedSize = static_cast<float>( font.mRequestedPointSize ) * FROM_266 / POINTS_PER_INCH * mDpiVertical;
+
+ if( desiredFixedSize > 0.f )
+ {
+ const float scaleFactor = desiredFixedSize / static_cast<float>( font.mFixedHeightPixels );
- metrics.ascender *= scaleFactor;
- metrics.descender *= scaleFactor;
- metrics.height *= scaleFactor;
- metrics.underlinePosition *= scaleFactor;
- metrics.underlineThickness *= scaleFactor;
+ metrics.ascender = floorf( metrics.ascender * scaleFactor );
+ metrics.descender = floorf( metrics.descender * scaleFactor );
+ metrics.height = floorf( metrics.height * scaleFactor );
+ metrics.underlinePosition = floorf( metrics.underlinePosition * scaleFactor );
+ metrics.underlineThickness = floorf( metrics.underlineThickness * scaleFactor );
+ }
}
}
else
bool FontClient::Plugin::GetGlyphMetrics( GlyphInfo* array,
uint32_t size,
GlyphType type,
- bool horizontal,
- int desiredFixedSize )
+ bool horizontal )
{
if( VECTOR_GLYPH == type )
{
- return GetVectorMetrics( array, size, horizontal, desiredFixedSize );
+ return GetVectorMetrics( array, size, horizontal );
}
- return GetBitmapMetrics( array, size, horizontal, desiredFixedSize );
+ return GetBitmapMetrics( array, size, horizontal );
}
bool FontClient::Plugin::GetBitmapMetrics( GlyphInfo* array,
uint32_t size,
- bool horizontal,
- int desiredFixedSize )
+ bool horizontal )
{
bool success( true );
for( unsigned int i=0; i<size; ++i )
{
- FontId fontId = array[i].fontId;
+ GlyphInfo& glyph = array[i];
+
+ FontId fontId = glyph.fontId;
if( fontId > 0 &&
fontId-1 < mFontCache.size() )
// Check to see if we should be loading a Fixed Size bitmap?
if ( font.mIsFixedSizeBitmap )
{
- int error = FT_Load_Glyph( ftFace, array[i].index, FT_LOAD_COLOR );
+ int error = FT_Load_Glyph( ftFace, glyph.index, FT_LOAD_COLOR );
if ( FT_Err_Ok == error )
{
- array[i].width = font.mFixedWidthPixels;
- array[i].height = font.mFixedHeightPixels;
- array[i].advance = font.mFixedWidthPixels;
- array[i].xBearing = 0.0f;
- array[i].yBearing = font.mFixedHeightPixels;
+ glyph.width = font.mFixedWidthPixels;
+ glyph.height = font.mFixedHeightPixels;
+ glyph.advance = font.mFixedWidthPixels;
+ glyph.xBearing = 0.0f;
+ glyph.yBearing = font.mFixedHeightPixels;
// Adjust the metrics if the fixed-size font should be down-scaled
- if( desiredFixedSize > 0 )
+ const float desiredFixedSize = static_cast<float>( font.mRequestedPointSize ) * FROM_266 / POINTS_PER_INCH * mDpiVertical;
+
+ if( desiredFixedSize > 0.f )
{
- float scaleFactor = static_cast<float>(desiredFixedSize) / static_cast<float>(font.mFixedHeightPixels);
+ const float scaleFactor = desiredFixedSize / static_cast<float>( font.mFixedHeightPixels );
- array[i].width *= scaleFactor;
- array[i].height *= scaleFactor;
- array[i].advance *= scaleFactor;
- array[i].xBearing *= scaleFactor;
- array[i].yBearing *= scaleFactor;
+ glyph.width = floorf( glyph.width * scaleFactor );
+ glyph.height = floorf( glyph.height * scaleFactor );
+ glyph.advance = floorf( glyph.advance * scaleFactor );
+ glyph.xBearing = floorf( glyph.xBearing * scaleFactor );
+ glyph.yBearing = floorf( glyph.yBearing * scaleFactor );
- array[i].scaleFactor = scaleFactor;
+ glyph.scaleFactor = scaleFactor;
}
}
else
else
#endif
{
- int error = FT_Load_Glyph( ftFace, array[i].index, FT_LOAD_DEFAULT );
+ int error = FT_Load_Glyph( ftFace, glyph.index, FT_LOAD_DEFAULT );
if( FT_Err_Ok == error )
{
- array[i].width = static_cast< float >( ftFace->glyph->metrics.width ) * FROM_266;
- array[i].height = static_cast< float >( ftFace->glyph->metrics.height ) * FROM_266 ;
+ glyph.width = static_cast< float >( ftFace->glyph->metrics.width ) * FROM_266;
+ glyph.height = static_cast< float >( ftFace->glyph->metrics.height ) * FROM_266 ;
if( horizontal )
{
- array[i].xBearing += static_cast< float >( ftFace->glyph->metrics.horiBearingX ) * FROM_266;
- array[i].yBearing += static_cast< float >( ftFace->glyph->metrics.horiBearingY ) * FROM_266;
+ glyph.xBearing += static_cast< float >( ftFace->glyph->metrics.horiBearingX ) * FROM_266;
+ glyph.yBearing += static_cast< float >( ftFace->glyph->metrics.horiBearingY ) * FROM_266;
}
else
{
- array[i].xBearing += static_cast< float >( ftFace->glyph->metrics.vertBearingX ) * FROM_266;
- array[i].yBearing += static_cast< float >( ftFace->glyph->metrics.vertBearingY ) * FROM_266;
+ glyph.xBearing += static_cast< float >( ftFace->glyph->metrics.vertBearingX ) * FROM_266;
+ glyph.yBearing += static_cast< float >( ftFace->glyph->metrics.vertBearingY ) * FROM_266;
}
}
else
bool FontClient::Plugin::GetVectorMetrics( GlyphInfo* array,
uint32_t size,
- bool horizontal,
- int desiredFixedSize )
+ bool horizontal )
{
#ifdef ENABLE_VECTOR_BASED_TEXT_RENDERING
bool success( true );
mVectorFontCache->GetGlyphMetrics( font.mVectorFontId, array[i] );
// Vector metrics are in EMs, convert to pixels
- float scale = (static_cast<float>(font.mPointSize)/64.0f) * mDpiVertical/72.0f;
+ const float scale = ( static_cast<float>( font.mRequestedPointSize ) * FROM_266 ) * static_cast<float>( mDpiVertical ) / POINTS_PER_INCH;
array[i].width *= scale;
array[i].height *= scale;
array[i].xBearing *= scale;
#endif
}
-const GlyphInfo& FontClient::Plugin::GetEllipsisGlyph( PointSize26Dot6 pointSize )
+const GlyphInfo& FontClient::Plugin::GetEllipsisGlyph( PointSize26Dot6 requestedPointSize )
{
// First look into the cache if there is an ellipsis glyph for the requested point size.
for( Vector<EllipsisItem>::ConstIterator it = mEllipsisCache.Begin(),
{
const EllipsisItem& item = *it;
- if( fabsf( item.size - pointSize ) < Math::MACHINE_EPSILON_1000 )
+ if( fabsf( item.requestedPointSize - requestedPointSize ) < Math::MACHINE_EPSILON_1000 )
{
// Use the glyph in the cache.
return item.glyph;
mEllipsisCache.PushBack( EllipsisItem() );
EllipsisItem& item = *( mEllipsisCache.End() - 1u );
- item.size = pointSize;
+ item.requestedPointSize = requestedPointSize;
// Find a font for the ellipsis glyph.
item.glyph.fontId = FindDefaultFont( ELLIPSIS_CHARACTER,
- pointSize,
+ requestedPointSize,
false );
// Set the character index to access the glyph inside the font.
item.glyph.index = FT_Get_Char_Index( mFontCache[item.glyph.fontId-1].mFreeTypeFace,
ELLIPSIS_CHARACTER );
- GetBitmapMetrics( &item.glyph, 1u, true, 0 );
+ GetBitmapMetrics( &item.glyph, 1u, true );
return item.glyph;
}
}
FontId FontClient::Plugin::CreateFont( const FontPath& path,
- PointSize26Dot6 pointSize,
+ PointSize26Dot6 requestedPointSize,
+ PointSize26Dot6 actualPointSize,
FaceIndex faceIndex,
bool cacheDescription )
{
// Ensure this size is available
for ( int i = 0; i < ftFace->num_fixed_sizes; ++i )
{
- if ( static_cast<FT_Pos>(pointSize) == ftFace->available_sizes[ i ].size )
+ if ( static_cast<FT_Pos>( actualPointSize ) == ftFace->available_sizes[ i ].size )
{
// Tell Freetype to use this size
error = FT_Select_Size( ftFace, i );
0.0f,
0.0f );
- mFontCache.push_back( CacheItem( ftFace, path, pointSize, faceIndex, metrics, fixedWidth, fixedHeight ) );
+ mFontCache.push_back( CacheItem( ftFace, path, requestedPointSize, faceIndex, metrics, fixedWidth, fixedHeight ) );
id = mFontCache.size();
if( cacheDescription )
{
- CacheFontPath( ftFace, id, pointSize, path );
+ CacheFontPath( ftFace, id, requestedPointSize, path );
}
+
return id;
}
}
sizes << ftFace->available_sizes[ i ].size;
}
DALI_LOG_ERROR( "FreeType Font: %s, does not contain Bitmaps of size: %d. Available sizes are: %s\n",
- path.c_str(), pointSize, sizes.str().c_str() );
+ path.c_str(), actualPointSize, sizes.str().c_str() );
}
else
{
error = FT_Set_Char_Size( ftFace,
0,
- pointSize,
+ actualPointSize,
mDpiHorizontal,
mDpiVertical );
static_cast< float >( ftFace->underline_position ) * FROM_266,
static_cast< float >( ftFace->underline_thickness ) * FROM_266 );
- mFontCache.push_back( CacheItem( ftFace, path, pointSize, faceIndex, metrics ) );
+ mFontCache.push_back( CacheItem( ftFace, path, requestedPointSize, faceIndex, metrics ) );
id = mFontCache.size();
if( cacheDescription )
{
- CacheFontPath( ftFace, id, pointSize, path );
+ CacheFontPath( ftFace, id, requestedPointSize, path );
}
}
else
{
- DALI_LOG_ERROR( "FreeType Set_Char_Size error: %d for pointSize %d\n", error, pointSize );
+ DALI_LOG_ERROR( "FreeType Set_Char_Size error: %d for pointSize %d\n", error, actualPointSize );
}
}
}
}
bool FontClient::Plugin::FindFont( const FontPath& path,
- PointSize26Dot6 pointSize,
+ PointSize26Dot6 requestedPointSize,
FaceIndex faceIndex,
FontId& fontId ) const
{
{
const CacheItem& cacheItem = *it;
- if( cacheItem.mPointSize == pointSize &&
+ if( cacheItem.mRequestedPointSize == requestedPointSize &&
cacheItem.mFaceIndex == faceIndex &&
cacheItem.mPath == path )
{
}
bool FontClient::Plugin::FindFont( FontDescriptionId validatedFontId,
- PointSize26Dot6 pointSize,
+ PointSize26Dot6 requestedPointSize,
FontId& fontId )
{
fontId = 0u;
const FontIdCacheItem& item = *it;
if( ( validatedFontId == item.validatedFontId ) &&
- ( pointSize == item.pointSize ) )
+ ( requestedPointSize == item.requestedPointSize ) )
{
fontId = item.fontId;
return true;
FcPatternDestroy( fontFamilyPattern );
}
-void FontClient::Plugin::CacheFontPath( FT_Face ftFace, FontId id, PointSize26Dot6 pointSize, const FontPath& path )
+void FontClient::Plugin::CacheFontPath( FT_Face ftFace, FontId id, PointSize26Dot6 requestedPointSize, const FontPath& path )
{
FontDescription description;
description.path = path;
mValidatedFontCache.push_back( item );
- // Cache the pair 'validatedFontId, pointSize' to improve the following queries.
+ // Cache the pair 'validatedFontId, requestedPointSize' to improve the following queries.
mFontIdCache.push_back( FontIdCacheItem( validatedFontId,
- pointSize,
+ requestedPointSize,
id ) );
}
}
struct FontIdCacheItem
{
FontIdCacheItem( FontDescriptionId validatedFontId,
- PointSize26Dot6 pointSize,
+ PointSize26Dot6 requestedPointSize,
FontId fontId );
- FontDescriptionId validatedFontId; ///< Index to the vector with font descriptions.
- PointSize26Dot6 pointSize; ///< The font point size.
- FontId fontId; ///< The font id.
+ FontDescriptionId validatedFontId; ///< Index to the vector with font descriptions.
+ PointSize26Dot6 requestedPointSize; ///< The font point size.
+ FontId fontId; ///< The font id.
};
/**
{
CacheItem( FT_Face ftFace,
const FontPath& path,
- PointSize26Dot6 pointSize,
+ PointSize26Dot6 requestedPointSize,
FaceIndex face,
const FontMetrics& metrics );
CacheItem( FT_Face ftFace,
const FontPath& path,
- PointSize26Dot6 pointSize,
+ PointSize26Dot6 requestedPointSize,
FaceIndex face,
const FontMetrics& metrics,
float fixedWidth,
float fixedHeight );
- FT_Face mFreeTypeFace; ///< The FreeType face.
- FontPath mPath; ///< The path to the font file name.
- PointSize26Dot6 mPointSize; ///< The font point size.
- FaceIndex mFaceIndex; ///< The face index.
- FontMetrics mMetrics; ///< The font metrics.
- FT_Short mFixedWidthPixels; ///< The height in pixels (fixed size bitmaps only)
- FT_Short mFixedHeightPixels; ///< The height in pixels (fixed size bitmaps only)
- unsigned int mVectorFontId; ///< The ID of the equivalent vector-based font
- bool mIsFixedSizeBitmap; ///< Whether the font has fixed size bitmaps.
+ FT_Face mFreeTypeFace; ///< The FreeType face.
+ FontPath mPath; ///< The path to the font file name.
+ PointSize26Dot6 mRequestedPointSize; ///< The font point size.
+ FaceIndex mFaceIndex; ///< The face index.
+ FontMetrics mMetrics; ///< The font metrics.
+ FT_Short mFixedWidthPixels; ///< The height in pixels (fixed size bitmaps only)
+ FT_Short mFixedHeightPixels; ///< The height in pixels (fixed size bitmaps only)
+ unsigned int mVectorFontId; ///< The ID of the equivalent vector-based font
+ bool mIsFixedSizeBitmap; ///< Whether the font has fixed size bitmaps.
};
struct EllipsisItem
{
- PointSize26Dot6 size;
+ PointSize26Dot6 requestedPointSize;
GlyphInfo glyph;
};
*/
FontId FindFontForCharacter( const FontList& fontList,
Character charcode,
- PointSize26Dot6 requestedSize,
+ PointSize26Dot6 requestedPointSize,
bool preferColor );
/**
* @copydoc Dali::FontClient::FindDefaultFont()
*/
- FontId FindDefaultFont( Character charcode, PointSize26Dot6 pointSize, bool preferColor );
+ FontId FindDefaultFont( Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor );
/**
* @copydoc Dali::FontClient::FindFallbackFont()
*/
- FontId FindFallbackFont( FontId preferredFont, Character charcode, PointSize26Dot6 requestedSize, bool preferColor );
+ FontId FindFallbackFont( FontId preferredFont, Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor );
/**
- * @see Dali::FontClient::GetFontId( const FontPath& path, PointSize26Dot6 pointSize, FaceIndex faceIndex )
+ * @see Dali::FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
*
+ * @param[in] actualPointSize The actual point size. In case of emojis the @p requestedPointSize is used to build the metrics and cache the font and the @p actualPointSize is used to load the glyph.
* @param[in] cacheDescription Whether to cache the font description.
*/
- FontId GetFontId( const FontPath& path, PointSize26Dot6 pointSize, FaceIndex faceIndex, bool cacheDescription = true );
+ FontId GetFontId( const FontPath& path,
+ PointSize26Dot6 requestedPointSize,
+ PointSize26Dot6 actualPointSize,
+ FaceIndex faceIndex,
+ bool cacheDescription = true );
/**
- * @copydoc Dali::FontClient::GetFontId( const FontDescription& fontDescription, PointSize26Dot6 pointSize, FaceIndex faceIndex )
+ * @copydoc Dali::FontClient::GetFontId( const FontDescription& fontDescription, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
*/
FontId GetFontId( const FontDescription& fontDescription,
- PointSize26Dot6 pointSize,
+ PointSize26Dot6 requestedPointSize,
+ PointSize26Dot6 actualPointSize,
FaceIndex faceIndex );
/**
/**
* @copydoc Dali::FontClient::GetFontMetrics()
*/
- void GetFontMetrics( FontId fontId, FontMetrics& metrics, int desiredFixedSize );
+ void GetFontMetrics( FontId fontId, FontMetrics& metrics );
/**
* @copydoc Dali::FontClient::GetGlyphIndex()
/**
* @copydoc Dali::FontClient::GetGlyphMetrics()
*/
- bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal, int desiredFixedSize );
+ bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal );
/**
* Helper for GetGlyphMetrics when using bitmaps
*/
- bool GetBitmapMetrics( GlyphInfo* array, uint32_t size, bool horizontal, int desiredFixedSize );
+ bool GetBitmapMetrics( GlyphInfo* array, uint32_t size, bool horizontal );
/**
* Helper for GetGlyphMetrics when using vectors
*/
- bool GetVectorMetrics( GlyphInfo* array, uint32_t size, bool horizontal, int desiredFixedSize );
+ bool GetVectorMetrics( GlyphInfo* array, uint32_t size, bool horizontal );
/**
* @copydoc Dali::FontClient::CreateBitmap()
/**
* @copydoc Dali::FontClient::GetEllipsisGlyph()
*/
- const GlyphInfo& GetEllipsisGlyph( PointSize26Dot6 pointSize );
+ const GlyphInfo& GetEllipsisGlyph( PointSize26Dot6 requestedPointSize );
private:
* @brief Creates a font.
*
* @param[in] path The path to the font file name.
- * @param[in] pointSize The font point size.
+ * @param[in] requestedPointSize The requested point size.
+ * @param[in] actualPointSize The actual point size (for color emojis).
* @param[in] faceIndex A face index.
* @param[in] cacheDescription Whether to cache the font description.
*
* @return The font id.
*/
- FontId CreateFont( const FontPath& path, PointSize26Dot6 pointSize, FaceIndex faceIndex, bool cacheDescription );
-
- /**
- * @brief Creates a fixed size font
- *
- * @param[in] path The path to the font file name.
- * @param[in] pointSize The font point size( must be an available size ).
- * @param[in] faceIndex A face index.
- * @param[in] cacheDescription Whether to cache the font description.
- *
- * @return The font id.
- */
- FontId CreateFixedSizeFont( const FontPath& path, PointSize26Dot6 pointSize, FaceIndex faceIndex, bool cacheDescription );
+ FontId CreateFont( const FontPath& path,
+ PointSize26Dot6 requestedPointSize,
+ PointSize26Dot6 actualPointSize,
+ FaceIndex faceIndex,
+ bool cacheDescription );
/**
*
* If there is one , if writes the font id in the param @p fontId.
*
* @param[in] path Path to the font file name.
- * @param[in] pointSize The font point size.
+ * @param[in] requestedPointSize The font point size.
* @param[in] faceIndex The face index.
* @param[out] fontId The font id.
*
* @return @e true if there triplet is found.
*/
- bool FindFont( const FontPath& path, PointSize26Dot6 pointSize, FaceIndex faceIndex, FontId& fontId ) const;
+ bool FindFont( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex, FontId& fontId ) const;
/**
* @brief Finds in the cache a cluster 'font family, font width, font weight, font slant'
* If there is one it writes the font id in the param @p fontId.
*
* @param[in] validatedFontId Index to the vector with font descriptions.
- * @param[in] pointSize The font point size.
+ * @param[in] requestedPointSize The font point size.
* @param[out] fontId The font id.
*
* @return @e true if the pair is found.
*/
bool FindFont( FontDescriptionId validatedFontId,
- PointSize26Dot6 pointSize,
+ PointSize26Dot6 requestedPointSize,
FontId& fontId );
/**
*
* @param[in] ftFace The FreeType face.
* @param[in] id The font identifier.
- * @param[in] pointSize The font point size.
+ * @param[in] requestedPointSize The font point size.
* @param[in] path Path to the font file name.
*/
- void CacheFontPath( FT_Face ftFace, FontId id, PointSize26Dot6 pointSize, const FontPath& path );
+ void CacheFontPath( FT_Face ftFace, FontId id, PointSize26Dot6 requestedPointSize, const FontPath& path );
private: