From 346c49b6c06d5b2e947e07b2b8e506f864201feb Mon Sep 17 00:00:00 2001 From: "ftang%netscape.com" Date: Thu, 15 Oct 1998 13:55:28 +0000 Subject: [PATCH] Make Toolbar menu measure and render UTF8 text. reviewed and approved by saari --- cmd/macfe/gui/CRDFToolbarItem.cp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/macfe/gui/CRDFToolbarItem.cp b/cmd/macfe/gui/CRDFToolbarItem.cp index 7c049c057172..9e4712fcfde2 100644 --- a/cmd/macfe/gui/CRDFToolbarItem.cp +++ b/cmd/macfe/gui/CRDFToolbarItem.cp @@ -240,8 +240,8 @@ CRDFPushButton :: CalcTitleFrame ( ) ::GetFontInfo(&theInfo); mCachedTitleFrame.top = mCachedButtonFrame.top; mCachedTitleFrame.left = mCachedButtonFrame.left; - mCachedTitleFrame.right = mCachedTitleFrame.left + ::StringWidth(LStr255(title));; - mCachedTitleFrame.bottom = mCachedTitleFrame.top + theInfo.ascent + theInfo.descent + theInfo.leading;; + mCachedTitleFrame.right = mCachedTitleFrame.left + UGraphicGizmos::GetUTF8TextWidth(title, strlen(title)); + mCachedTitleFrame.bottom = mCachedTitleFrame.top + theInfo.ascent + theInfo.descent + theInfo.leading; if (mCurrentMode != eTOOLBAR_TEXT) { @@ -405,7 +405,7 @@ CRDFPushButton::GetPlacement( placement& outPlacement, SDimension16 space_availa // minChars = atoi(minChars); if ( minChars < itemText.length() ) itemText[minChars] = '\0'; - UInt16 textWidth = ::StringWidth(LStr255(itemText.c_str())); + UInt16 textWidth = UGraphicGizmos::GetUTF8TextWidth(itemText.c_str(), itemText.length()) ; outPlacement.max_horizontal_shrink = outPlacement.natural_size.width - (graphicWidth + textWidth + kBullshitSpacingConstant); @@ -569,7 +569,7 @@ CRDFPushButton :: DrawButtonTitle ( ) } char* title = HT_GetNodeName(HTNode()); - UGraphicGizmos::PlaceStringInRect(LStr255(title), mCachedTitleFrame, teCenter, teCenter); + UGraphicGizmos::PlaceUTF8TextInRect(title, strlen(title), mCachedTitleFrame, teCenter, teCenter); } // DrawButtonTitle