【SonicUI】關於字型高亮的問題。。,sonicui字型高亮
m_pSonicString[1]->Format(_T("/c=%x, a='http://hi.csdn.net/', linkh=0xFF00F0, font, font_height=25, font_bold=1, font_italic=1/點我開啟連結uM"),RGB(128,0,32));m_pSonicString[2]->Format(_T("/c=%x, a='http://hi.csdn.net/', linkh=0xFF00F0, font, font_height=25, font_bold=1, font_italic=0/點我開啟連結uM"),RGB(128,0,32));
測試代碼如上:
通過程式碼分析,發現了作者使用的是 API GetTextExtentPoint32
BOOL GetTextExtentPoint32( HDC hdc, // handle to DC LPCTSTR lpString, // text string int c, // characters in string LPSIZE lpSize // string size);
這個是函數是可以擷取到字串的寬度。。但是沒有區分Italic類型,所以才會出現以上高亮後的問題。。
if (block.Font.bItalic){UINT nChar = (UINT)block.strText.GetAt(strlen(block.strText) + -1);if (nChar >= 0xA0){nChar = ((UINT)block.strText.GetAt(strlen(block.strText) + -2) >> 8) + nChar;nChar = nChar & 0xFFFF;int nWidth;GetCharWidth32(hdc,nChar ,nChar ,&nWidth);nBlockWidth = sz.cx + nWidth;}else{ABC czAbc = {0};GetCharABCWidths(hdc,nChar,nChar,&czAbc);nBlockWidth = sz.cx - czAbc.abcC;}}else{nBlockWidth = sz.cx;}
\SonicUI_src\SonicUI\SonicString.cpp 477line 更改支援中英文。。
</pre><pre class="cpp" name="code">BOOL GetCharABCWidths( HDC hdc, // handle to DC UINT uFirstChar, // first character in range UINT uLastChar, // last character in range LPABC lpabc // array of character widths);
通過這個函數擷取當前字型下,最後一個字元的寬度。。可以很好的完全顯示出來!
哪種瀏覽器可以設定字型高亮?
世界之窗瀏覽器(the word), 具體方法可以去官網論壇問問····
怎在ps 中得到 高亮文字?
你說的這種字型一般美工都會做,我叫它為“網頁字”
1.在ps功能表列中,視窗》字元 選中,會出現字元選項框
2.在選項框最下邊,“美國英語”旁邊,有個選項框,選“無”,就會出現這種情況了
注意:字型必須選宋體,12號字是效果最好的,也是網頁上用的最多的。
希望樓主早日解決問題!