中英文本型名對映

2021-10-09 03:16:08 字數 1248 閱讀 1494

上篇文章可以把英文本型名對映到檔名,這篇文章(其實只有**)通過directwrite庫接著把中英文本型做個對映。

#include

#include

#include

#include

#include

#include

#include

// saferelease inline function.

template

<

class

t>

inline

void

saferelease

(t *

*ppt)

}std::wstring getfontfacenamepair

(idwritelocalizedstrings* pfamilynames, uint32 index)

// get the family name.if(

succeeded

(hr))if

(succeeded

(hr)

)delete

name;

return result;

}std::map

fontfacemap()

idwritelocalizedstrings* pfamilynames =

null

;// get a list of localized strings for the family name.if(

succeeded

(hr)

)saferelease

(&pfamilynames);}

saferelease

(&pfontfamily);}

}saferelease

(&pfontcollection);}

saferelease

(&pdwritefactory);}

return map;

}int

main()

輸出

微軟雅黑=>microsoft yahei

microsoft yahei ui=>microsoft yahei ui

宋體=>simsun

新宋體=>nsimsun

等線=>dengxian

仿宋=>fangsong

楷體=>kaiti

黑體=>simhei

LATEX如何設定英文本型,中英文標題

設定英文本型 setmainfont newcommand tm 則會顯示成 helloworld 中間不會有空格 則會顯示成 hello world 中英文標題 usepackage declarecaptionoption renewcommand tablename captionsetup ...

中英文本串擷取

substringlength 每行限制文字數量 預設是20個字元 按照英文本元長度來計算,乙個中文字元相當於兩個英文本元 replacecharacter 超出字元代替樣式 預設是 擷取字元 string substring string strinput return resultstr rep...

string中英文本元

在c 中字串類的string的模板原型是basic string template class elem,class traits char traits elem class ax allocator elem class basic string 第乙個引數 elem表示型別。第二個引數trai...