X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fshaper.cpp;h=593e1e564319f8ea644fb928d779b09f8d15c051;hp=cd0b1d7e09a403c82d9cc79f87a9157c911794f2;hb=refs%2Fchanges%2F94%2F215094%2F2;hpb=e5ca10134c73ca0588f893adde82694ad907dd8d diff --git a/dali-toolkit/internal/text/shaper.cpp b/dali-toolkit/internal/text/shaper.cpp index cd0b1d7..593e1e5 100644 --- a/dali-toolkit/internal/text/shaper.cpp +++ b/dali-toolkit/internal/text/shaper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 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. @@ -111,9 +111,13 @@ void ShapeText( const Vector& text, // There is no way to know the number of glyphs before shaping the text. // To avoid reallocations it's reserved space for a slightly biger number of glyphs than the number of characters. + GlyphInfo glyphInfo; + glyphInfo.isItalicRequired = false; + glyphInfo.isBoldRequired = false; + const Length currentNumberOfGlyphs = glyphs.Count(); const Length numberOfGlyphsReserved = static_cast( numberOfCharacters * 1.3f ); - glyphs.Resize( currentNumberOfGlyphs + numberOfGlyphsReserved ); + glyphs.Resize( currentNumberOfGlyphs + numberOfGlyphsReserved, glyphInfo ); glyphToCharacterMap.Resize( currentNumberOfGlyphs + numberOfGlyphsReserved ); // The actual number of glyphs. @@ -137,6 +141,8 @@ void ShapeText( const Vector& text, currentFontId = fontRun.fontId; currentScript = scriptRun.script; + const bool isItalicRequired = fontRun.isItalicRequired; + const bool isBoldRequired = fontRun.isBoldRequired; // Get the min index to the last character of both runs. CharacterIndex currentIndex = min( fontRun.characterRun.characterIndex + fontRun.characterRun.numberOfCharacters, @@ -170,7 +176,12 @@ void ShapeText( const Vector& text, // Retrieve the glyphs and the glyph to character conversion map. Vector tmpGlyphs; Vector tmpGlyphToCharacterMap; - tmpGlyphs.Resize( numberOfGlyphs ); + + GlyphInfo glyphInfo; + glyphInfo.isItalicRequired = isItalicRequired; + glyphInfo.isBoldRequired = isBoldRequired; + + tmpGlyphs.Resize( numberOfGlyphs, glyphInfo ); tmpGlyphToCharacterMap.Resize( numberOfGlyphs ); shaping.GetGlyphs( tmpGlyphs.Begin(), tmpGlyphToCharacterMap.Begin() );