From b691f9f00c082e7924f7ba748936abb781ef1863 Mon Sep 17 00:00:00 2001 From: Sungyeon Woo Date: Mon, 6 May 2013 09:23:45 +0900 Subject: [PATCH] fixed wrong boldspace bug when apply boldstyle Change-Id: I3b0ba95dacc2555472189dde8d744f1e90fbe29c Signed-off-by: Sungyeon Woo --- src/graphics/FGrp_Font.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/graphics/FGrp_Font.cpp b/src/graphics/FGrp_Font.cpp index 9dee62f..9574495 100644 --- a/src/graphics/FGrp_Font.cpp +++ b/src/graphics/FGrp_Font.cpp @@ -9,7 +9,7 @@ // 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, +// 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. @@ -101,6 +101,7 @@ namespace // unnamed { const _Util::FixedPoint26_6 _SYSTEM_DEFAULT_FONT_SIZE(16); +const long _MEDIUM_FONT_BOLD_WEIGHT = 600; template inline void @@ -1045,7 +1046,10 @@ _Font::__GetTextExtent(int width, const _Util::String& text, bool outline, int& } } - if (__fontAttrib.style & FONT_STYLE_BOLD) + _IFont::Property property; + GET_FONT_PROPERTY(property, false); + + if (__fontAttrib.style & FONT_STYLE_BOLD && property.weightClass < _MEDIUM_FONT_BOLD_WEIGHT) { _IFont::Attrib attr; pThis->GetAttrib(attr); @@ -1204,7 +1208,10 @@ _Font::__GetTextExtentList(const _Util::String& text, _Util::AccumList<_Util::Pa } #endif - if (__fontAttrib.style & FONT_STYLE_BOLD) + _IFont::Property property; + GET_FONT_PROPERTY(property, false); + + if (__fontAttrib.style & FONT_STYLE_BOLD && property.weightClass < _MEDIUM_FONT_BOLD_WEIGHT) { _IFont::Attrib attr; @@ -1570,7 +1577,10 @@ _Font::__DrawText(_Canvas& canvas, const Point& point, const Tizen::Base::String } } - if (this->GetStyle() & FONT_STYLE_BOLD) + _IFont::Property property; + GET_FONT_PROPERTY(property, false); + + if (__fontAttrib.style & FONT_STYLE_BOLD && property.weightClass < _MEDIUM_FONT_BOLD_WEIGHT) { _IFont::Attrib attr; this->GetAttrib(attr); -- 2.7.4