var fontname:String="MS-Gothic"
if let path:NSString=NSBundle.mainBundle().pathForResource("hogeFont", ofType:"ttf"){
let cchr:UnsafePointer<CChar>=path.cStringUsingEncoding(NSUTF8StringEncoding)
if let name=String.fromCString( HPDF_LoadTTFontFromFile(_pdf, cchr, HPDF_TRUE) ){
fontname=name
}else{
println("埋め込みフォント名が不明")
}
}else{
println("埋め込みフォントが見つからない")
}
let fontJp = HPDF_GetFont(_pdf, fontname, "90ms-RKSJ-H")//sjis
HPDF_Page_SetFontAndSize(_currentPage, fontJp, a_fontSize)
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
00