fixed wrong boldspace bug when apply boldstyle
authorSungyeon Woo <s.woo@samsung.com>
Mon, 6 May 2013 00:23:45 +0000 (09:23 +0900)
committerSungyeon Woo <s.woo@samsung.com>
Mon, 6 May 2013 00:41:40 +0000 (09:41 +0900)
Change-Id: I3b0ba95dacc2555472189dde8d744f1e90fbe29c
Signed-off-by: Sungyeon Woo <s.woo@samsung.com>
src/graphics/FGrp_Font.cpp

index 9dee62f..9574495 100644 (file)
@@ -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<typename Type>
 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);