X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fshaper.cpp;h=de41d0e2961529d773108573394d0156dd272871;hb=f8abce594a03f5c11e363da5c13f54000496008a;hp=624c443b92d639fde01e6d0b72483f91cde8d563;hpb=f8336fdc865faf2c19fe880252ad3bf1bb0aaee4;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/shaper.cpp b/dali-toolkit/internal/text/shaper.cpp old mode 100644 new mode 100755 index 624c443..de41d0e --- 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,10 +111,14 @@ 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 ); - glyphToCharacterMap.Resize( currentNumberOfGlyphs + numberOfGlyphsReserved ); + glyphs.Reserve( currentNumberOfGlyphs + numberOfGlyphsReserved ); + glyphToCharacterMap.Reserve( currentNumberOfGlyphs + numberOfGlyphsReserved ); // The actual number of glyphs. Length totalNumberOfGlyphs = currentNumberOfGlyphs; @@ -137,8 +141,8 @@ void ShapeText( const Vector& text, currentFontId = fontRun.fontId; currentScript = scriptRun.script; - bool softwareItalic = fontRun.softwareItalic; - bool softwareBold = fontRun.softwareBold; + 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, @@ -174,8 +178,8 @@ void ShapeText( const Vector& text, Vector tmpGlyphToCharacterMap; GlyphInfo glyphInfo; - glyphInfo.softwareItalic = softwareItalic; - glyphInfo.softwareBold = softwareBold; + glyphInfo.isItalicRequired = isItalicRequired; + glyphInfo.isBoldRequired = isBoldRequired; tmpGlyphs.Resize( numberOfGlyphs, glyphInfo ); tmpGlyphToCharacterMap.Resize( numberOfGlyphs );