const char* LANDSCAPE_QUALIFIER = "landscape";
const char* PORTRAIT_QUALIFIER = "portrait";
+const char* FONT_SIZE_QUALIFIER = "font-size-";
const char* DEFAULT_THEME = DALI_STYLE_DIR "tizen-default-theme.json";
}
StyleManager::StyleManager()
- : mOrientationDegrees( 0 ) // Portrait
+: mOrientationDegrees( 0 ), // Portrait
+ mDefaultFontSize( -1 )
{
// Add theme builder constants
mThemeBuilderConstants[ PACKAGE_PATH_KEY ] = DEFAULT_PACKAGE_PATH;
if( styleMonitor )
{
styleMonitor.StyleChangeSignal().Connect( this, &StyleManager::StyleMonitorChange );
+
+ mDefaultFontSize = styleMonitor.GetDefaultFontSize();
}
}
// Remove the last qualifier in an attempt to find a style that is valid
qualifiers.pop_back();
}
+
+ if( mDefaultFontSize >= 0 )
+ {
+ // Apply the style for logical font size
+ std::stringstream fontSizeQualifier;
+ fontSizeQualifier << styleName << "-" << FONT_SIZE_QUALIFIER << mDefaultFontSize;
+ builder.ApplyStyle( fontSizeQualifier.str(), control );
+ }
}
void StyleManager::ApplyThemeStyle( Toolkit::Control control )
void StyleManager::StyleMonitorChange( StyleMonitor styleMonitor, StyleChange styleChange )
{
+ if( styleChange.defaultFontSizeChange )
+ {
+ mDefaultFontSize = styleMonitor.GetDefaultFontSize();
+ }
+
mStyleChangeSignal.Emit( Toolkit::StyleManager::Get(), styleChange );
}
Orientation mOrientation; ///< Handle to application orientation object
int mOrientationDegrees; ///< Directly set value of orientation
+ int mDefaultFontSize; ///< Logical size, not a point-size
+
std::string mThemeFile; ///< The full path of the current theme file
Property::Map mThemeBuilderConstants; ///< Contants to give the theme builder
{
// Check in the valid fonts cache.
ValidateFontsPerScript* validateFontsPerScript = *( validFontsPerScriptCacheBuffer + script );
+
+ if( NULL == validateFontsPerScript )
+ {
+ validateFontsPerScript = new ValidateFontsPerScript();
+ }
+
if( NULL != validateFontsPerScript )
{
if( !validateFontsPerScript->FindValidFont( fontId ) )
{
// Use the font client to validate the font.
- const GlyphIndex glyphIndex = fontClient.GetGlyphIndex( fontId, character );
+ GlyphIndex glyphIndex = fontClient.GetGlyphIndex( fontId, character );
+
+ // Emojis are present in many monochrome fonts; prefer color by default.
+ if( TextAbstraction::EMOJI == script &&
+ 0u != glyphIndex )
+ {
+ BufferImage bitmap = fontClient.CreateBitmap( fontId, glyphIndex );
+ if( bitmap &&
+ Pixel::BGRA8888 != bitmap.GetPixelFormat() )
+ {
+ glyphIndex = 0;
+ }
+ }
if( 0u == glyphIndex )
{
}
}
}
- else
- {
- // Use the font client to validate the font.
- const GlyphIndex glyphIndex = fontClient.GetGlyphIndex( fontId, character );
-
- if( 0u == glyphIndex )
- {
- // Get the point size of the current font. It will be used to get a default font id.
- pointSize = fontClient.GetPointSize( fontId );
-
- // The font is not valid. Set to zero and a default one will be set.
- fontId = 0u;
- }
- else if( !IsValidForAllScripts( character ) )
- {
- // Add the font to the valid font cache.
- validateFontsPerScript = new ValidateFontsPerScript();
- *( validFontsPerScriptCacheBuffer + script ) = validateFontsPerScript;
-
- validateFontsPerScript->mValidFonts.PushBack( fontId );
- }
- }
}
} // !isDefault
mImpl->mFontDefaults->mFontId = 0u; // Remove old font ID
mImpl->mOperationsPending = ALL_OPERATIONS;
mImpl->mRecalculateNaturalSize = true;
+
+ // Clear the font-specific data
+ mImpl->mLogicalModel->mFontRuns.Clear();
+ mImpl->mVisualModel->mGlyphs.Clear();
+ mImpl->mVisualModel->mGlyphsToCharacters.Clear();
+ mImpl->mVisualModel->mCharactersToGlyph.Clear();
+ mImpl->mVisualModel->mCharactersPerGlyph.Clear();
+ mImpl->mVisualModel->mGlyphsPerCharacter.Clear();
+ mImpl->mVisualModel->mGlyphPositions.Clear();
+ mImpl->mVisualModel->mLines.Clear();
+
+ RequestRelayout();
}
const std::string& Controller::GetDefaultFontFamily() const
mImpl->mFontDefaults->mFontId = 0u; // Remove old font ID
mImpl->mOperationsPending = ALL_OPERATIONS;
mImpl->mRecalculateNaturalSize = true;
+
+ // Clear the font-specific data
+ mImpl->mLogicalModel->mFontRuns.Clear();
+ mImpl->mVisualModel->mGlyphs.Clear();
+ mImpl->mVisualModel->mGlyphsToCharacters.Clear();
+ mImpl->mVisualModel->mCharactersToGlyph.Clear();
+ mImpl->mVisualModel->mCharactersPerGlyph.Clear();
+ mImpl->mVisualModel->mGlyphsPerCharacter.Clear();
+ mImpl->mVisualModel->mGlyphPositions.Clear();
+ mImpl->mVisualModel->mLines.Clear();
+
+ RequestRelayout();
}
const std::string& Controller::GetDefaultFontStyle() const
mImpl->mFontDefaults->mFontId = 0u; // Remove old font ID
mImpl->mOperationsPending = ALL_OPERATIONS;
mImpl->mRecalculateNaturalSize = true;
+
+ // Clear the font-specific data
+ mImpl->mLogicalModel->mFontRuns.Clear();
+ mImpl->mVisualModel->mGlyphs.Clear();
+ mImpl->mVisualModel->mGlyphsToCharacters.Clear();
+ mImpl->mVisualModel->mCharactersToGlyph.Clear();
+ mImpl->mVisualModel->mCharactersPerGlyph.Clear();
+ mImpl->mVisualModel->mGlyphsPerCharacter.Clear();
+ mImpl->mVisualModel->mGlyphPositions.Clear();
+ mImpl->mVisualModel->mLines.Clear();
+
+ RequestRelayout();
}
float Controller::GetDefaultPointSize() const
"textlabel":
{
"font-family":"SamsungSans",
- "font-style":"Regular",
- "point-size":12
+ "font-style":"Regular"
},
+
+ "textlabel-font-size-0":
+ {
+ "point-size":8
+ },
+ "textlabel-font-size-1":
+ {
+ "point-size":10
+ },
+ "textlabel-font-size-2":
+ {
+ "point-size":15
+ },
+ "textlabel-font-size-3":
+ {
+ "point-size":19
+ },
+ "textlabel-font-size-4":
+ {
+ "point-size":25
+ },
+
"textfield":
{
"font-family":"SamsungSans",
- "font-style":"Regular",
- "point-size":12
+ "font-style":"Regular"
},
+
+ "textfield-font-size-0":
+ {
+ "point-size":10
+ },
+ "textfield-font-size-1":
+ {
+ "point-size":10
+ },
+ "textfield-font-size-2":
+ {
+ "point-size":10
+ },
+ "textfield-font-size-3":
+ {
+ "point-size":10
+ },
+ "textfield-font-size-4":
+ {
+ "point-size":10
+ },
+
"scrollview":
{
"overshoot-effect-color":"B018"
Name: dali-toolkit
Summary: The OpenGLES Canvas Core Library Toolkit
-Version: 1.0.33
+Version: 1.0.34
Release: 1
Group: System/Libraries
License: Apache-2.0
URL: https://review.tizen.org/git/?p=platform/core/uifw/dali-toolkit.git;a=summary
Source0: %{name}-%{version}.tar.gz
+%define dali_profile MOBILE
+
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
Requires: dali
autoreconf --install
DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
-%configure
+%configure --enable-profile=%{dali_profile}
make %{?jobs:-j%jobs}
##############################