{"id":268,"date":"2009-04-22T17:11:52","date_gmt":"2009-04-22T17:11:52","guid":{"rendered":"http:\/\/apollo89.com\/wordpress\/?p=268"},"modified":"2013-11-14T09:14:19","modified_gmt":"2013-11-14T00:14:19","slug":"custom-font-%ec%93%b0%eb%8a%94-%eb%b2%95","status":"publish","type":"post","link":"https:\/\/apollo89.com\/wordpress\/?p=268","title":{"rendered":"iPhone\uc5d0\uc11c Custom font \uc4f0\ub294 \ubc95"},"content":{"rendered":"<p>&nbsp;<br \/>\niPhone\uc5d0\uc11c Custom font \uc4f0\ub294 \ubc95<br \/>\n( test.ttf\ub77c\ub294 \ud3f0\ud2b8\ub97c \uc0ac\uc6a9\ud560 \ub54c )<\/p>\n<p>1. \ud3f0\ud2b8\ud30c\uc77c\uc744 xcode \ud504\ub85c\uc81d\ud2b8\ub85c \uae01\uc5b4 \ub123\ub294\ub2e4.<\/p>\n<p>2. \uc544\ub798\uc640 \uac19\uc740 \ubc29\uc2dd\uc73c\ub85c \uba54\ubaa8\ub9ac \ub85c\ub529 \ud6c4 \uc0ac\uc6a9\ud55c\ub2e4.<\/p>\n<pre class=\"lang:objc decode:true \" >NSString *fontPath = [[NSBundle mainBundle] pathForResource:@\"test\" ofType:@\"ttf\"];\r\nCGDataProviderRef fontDataProvider = CGDataProviderCreateWithFilename([fontPath UTF8String]);\r\nCGFontRef _cgFont = CGFontCreateWithDataProvider(fontDataProvider);\r\nCGDataProviderRelease(fontDataProvider);\r\n\r\nCGContextRef context = UIGraphicsGetCurrentContext();\r\nCGContextSetFont(context, _cgFont);\r\nCGContextSetFontSize(context, 20);\r\n\r\nCGAffineTransform transform = CGAffineTransformMake(1.0, 0.0, 0.0, -1.0, 0.0, 0.0);\r\nCGContextSetTextMatrix(context, transform);\r\n\r\nNSString *str = @\"Hello? \uc548\ub155?\";\r\nCGGlyph _glyphs[[str length]];\r\nunichar _chars[[str length]];\r\nint i;\r\nfor(i = 0; i &lt; [str length]; i++) {\r\n\t_chars[i] = [str characterAtIndex:i];\r\n}\r\nCGFontGetGlyphsForUnichars(_cgFont, _chars, _glyphs, [str length]);\r\nCGContextShowGlyphsAtPoint(context, 0, 20, _glyphs, [str length]);\r\nCGFontRelease(_cgFont);<\/pre>\n<p>\uc704\uc5d0\uc11c CGFontGetGlyphsForUnichars\ub294 \ud5e4\ub354\ud30c\uc77c\uc5d0\ub3c4 \uc120\uc5b8\ub418\uc9c0\uc54a\uc740 \ud568\uc218\ub77c\uc11c warning\uc774 \ub098\uc62c \uc218 \uc788\ub2e4.<br \/>\n\ub530\ub77c\uc11c, \uc544\ub798\uc640 \uac19\uc774 \uc120\uc5b8\uc744 \ud574\ub450\uba74 warning\uc774 \ub098\uc624\uc9c0 \uc54a\ub294\ub2e4.<br \/>\nbool CGFontGetGlyphsForUnichars(CGFontRef, unichar[], CGGlyph[], size_t);<br \/>\n\ubb38\uc790\uc0c9\uc744 \uc9c0\uc815\ud560 \ub54c\ub294 \uc704\uc758 \uc608\uc81c\uc640 \uac19\uc774 CGContextSetFillColorWithColor\ub85c \uc120\uc5b8\ud558\uba70, \uc774 \ub54c \uc0ac\uc6a9\uc774 \uac04\ud3b8\ud55c UIColor\ub97c \uc0ac\uc6a9\ud558\uc5ec CGColorRef\ub97c \uc0ac\uc6a9\ud558\ub294 \uac83\uc774 \uc88b\ub2e4.<br \/>\n\uc800\ub294 \uc77c\ub2e8, FontManager\ub780\uac78 \ub9cc\ub4e4\uc5b4\ub193\uace0, AppDelegate\uc5d0\uc11c \ud55c\ubc88\uc5d0 \ub85c\ub529\ud574\uc11c \uc4f0\ub294 \ubc29\uc2dd\uc73c\ub85c \ud574\uc11c,<\/p>\n<p>UIView, UITextView, UITableViewCell\ub4f1\uc5d0\uc11c \uc0ac\uc6a9\ud574\ubcf8 \uacb0\uacfc \ub9cc\uc871\ud560 \ub9cc \ud588\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\ub2e4\ub9cc, \uc800, CGFontGetGlyphsForUnichars\ub780 \ud568\uc218\uac00 \uc5b8\uc81c\uae4c\uc9c0 \ub0a8\uc544\uc788\uc744 \uc9c0\uac00 \ubb38\uc81c\uc8e0.<\/p>\n<p>\uc9c0\uae08 \ub9cc\ub4e4\uace0 \uc788\ub294 \uc5b4\ud50c\uc911 \uc2a4\ud06c\ub9b0\uc0f7\uc744 \ud574\ubd24\uc2b5\ub2c8\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/apollo89.com\/wordpress\/wp-content\/uploads\/1\/1341746382.png\" alt=\"screenshot_2009.04.11_17.59.22_dirmich.png\" class=\"alignnone size-full wp-image-269\" \/><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; iPhone\uc5d0\uc11c Custom font \uc4f0\ub294 \ubc95 ( test.ttf\ub77c\ub294 \ud3f0\ud2b8\ub97c \uc0ac\uc6a9\ud560 \ub54c ) 1. \ud3f0\ud2b8\ud30c\uc77c\uc744 xcode \ud504\ub85c\uc81d\ud2b8\ub85c \uae01\uc5b4 \ub123\ub294\ub2e4. 2. \uc544\ub798\uc640 \uac19\uc740 \ubc29\uc2dd\uc73c\ub85c \uba54\ubaa8\ub9ac \ub85c\ub529 \ud6c4 \uc0ac\uc6a9\ud55c\ub2e4. NSString *fontPath = [[NSBundle mainBundle] pathForResource:@&#8221;test&#8221; ofType:@&#8221;ttf&#8221;]; CGDataProviderRef fontDataProvider = CGDataProviderCreateWithFilename([fontPath UTF8String]); CGFontRef _cgFont &hellip; <a href=\"https:\/\/apollo89.com\/wordpress\/?p=268\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[736],"tags":[261,274],"class_list":["post-268","post","type-post","status-publish","format-standard","hentry","category-objective-ciphone","tag-iphone","tag-274"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>iPhone\uc5d0\uc11c Custom font \uc4f0\ub294 \ubc95 - Apollo89.com<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/apollo89.com\/wordpress\/?p=268\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"iPhone\uc5d0\uc11c Custom font \uc4f0\ub294 \ubc95 - Apollo89.com\" \/>\n<meta property=\"og:description\" content=\"&nbsp; iPhone\uc5d0\uc11c Custom font \uc4f0\ub294 \ubc95 ( test.ttf\ub77c\ub294 \ud3f0\ud2b8\ub97c \uc0ac\uc6a9\ud560 \ub54c ) 1. \ud3f0\ud2b8\ud30c\uc77c\uc744 xcode \ud504\ub85c\uc81d\ud2b8\ub85c \uae01\uc5b4 \ub123\ub294\ub2e4. 2. \uc544\ub798\uc640 \uac19\uc740 \ubc29\uc2dd\uc73c\ub85c \uba54\ubaa8\ub9ac \ub85c\ub529 \ud6c4 \uc0ac\uc6a9\ud55c\ub2e4. NSString *fontPath = [[NSBundle mainBundle] pathForResource:@&quot;test&quot; ofType:@&quot;ttf&quot;]; CGDataProviderRef fontDataProvider = CGDataProviderCreateWithFilename([fontPath UTF8String]); CGFontRef _cgFont &hellip; Continue reading &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/apollo89.com\/wordpress\/?p=268\" \/>\n<meta property=\"og:site_name\" content=\"Apollo89.com\" \/>\n<meta property=\"article:published_time\" content=\"2009-04-22T17:11:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2013-11-14T00:14:19+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/apollo89.com\/wordpress\/wp-content\/uploads\/1\/1341746382.png\" \/>\n<meta name=\"author\" content=\"apollo89\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"apollo89\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"1\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/apollo89.com\\\/wordpress\\\/?p=268#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/apollo89.com\\\/wordpress\\\/?p=268\"},\"author\":{\"name\":\"apollo89\",\"@id\":\"https:\\\/\\\/apollo89.com\\\/wordpress\\\/#\\\/schema\\\/person\\\/93f56825cac3b2f18e5f107995066c82\"},\"headline\":\"iPhone\uc5d0\uc11c Custom font \uc4f0\ub294 \ubc95\",\"datePublished\":\"2009-04-22T17:11:52+00:00\",\"dateModified\":\"2013-11-14T00:14:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/apollo89.com\\\/wordpress\\\/?p=268\"},\"wordCount\":30,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/apollo89.com\\\/wordpress\\\/?p=268#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/apollo89.com\\\/wordpress\\\/wp-content\\\/uploads\\\/1\\\/1341746382.png\",\"keywords\":[\"\uc544\uc774\ud3f0\",\"\ud3f0\ud2b8\"],\"articleSection\":[\"Objective-C\\\/iPhone\"],\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/apollo89.com\\\/wordpress\\\/?p=268#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/apollo89.com\\\/wordpress\\\/?p=268\",\"url\":\"https:\\\/\\\/apollo89.com\\\/wordpress\\\/?p=268\",\"name\":\"iPhone\uc5d0\uc11c Custom font \uc4f0\ub294 \ubc95 - Apollo89.com\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/apollo89.com\\\/wordpress\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/apollo89.com\\\/wordpress\\\/?p=268#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/apollo89.com\\\/wordpress\\\/?p=268#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/apollo89.com\\\/wordpress\\\/wp-content\\\/uploads\\\/1\\\/1341746382.png\",\"datePublished\":\"2009-04-22T17:11:52+00:00\",\"dateModified\":\"2013-11-14T00:14:19+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/apollo89.com\\\/wordpress\\\/#\\\/schema\\\/person\\\/93f56825cac3b2f18e5f107995066c82\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/apollo89.com\\\/wordpress\\\/?p=268#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/apollo89.com\\\/wordpress\\\/?p=268\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\\\/\\\/apollo89.com\\\/wordpress\\\/?p=268#primaryimage\",\"url\":\"http:\\\/\\\/apollo89.com\\\/wordpress\\\/wp-content\\\/uploads\\\/1\\\/1341746382.png\",\"contentUrl\":\"http:\\\/\\\/apollo89.com\\\/wordpress\\\/wp-content\\\/uploads\\\/1\\\/1341746382.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/apollo89.com\\\/wordpress\\\/?p=268#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\\\/\\\/apollo89.com\\\/wordpress\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"iPhone\uc5d0\uc11c Custom font \uc4f0\ub294 \ubc95\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/apollo89.com\\\/wordpress\\\/#website\",\"url\":\"https:\\\/\\\/apollo89.com\\\/wordpress\\\/\",\"name\":\"Apollo89.com\",\"description\":\"\uc544\ud3f4\ub85c\uc528\uc758 \uc7a1\ub2e4\ud55c \uacbd\ud5d8\ub4e4..\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/apollo89.com\\\/wordpress\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/apollo89.com\\\/wordpress\\\/#\\\/schema\\\/person\\\/93f56825cac3b2f18e5f107995066c82\",\"name\":\"apollo89\",\"description\":\"\uc544\ud3f4\ub85c89 \uc785\ub2c8\ub2e4.\",\"url\":\"https:\\\/\\\/apollo89.com\\\/wordpress\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"iPhone\uc5d0\uc11c Custom font \uc4f0\ub294 \ubc95 - Apollo89.com","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/apollo89.com\/wordpress\/?p=268","og_locale":"ko_KR","og_type":"article","og_title":"iPhone\uc5d0\uc11c Custom font \uc4f0\ub294 \ubc95 - Apollo89.com","og_description":"&nbsp; iPhone\uc5d0\uc11c Custom font \uc4f0\ub294 \ubc95 ( test.ttf\ub77c\ub294 \ud3f0\ud2b8\ub97c \uc0ac\uc6a9\ud560 \ub54c ) 1. \ud3f0\ud2b8\ud30c\uc77c\uc744 xcode \ud504\ub85c\uc81d\ud2b8\ub85c \uae01\uc5b4 \ub123\ub294\ub2e4. 2. \uc544\ub798\uc640 \uac19\uc740 \ubc29\uc2dd\uc73c\ub85c \uba54\ubaa8\ub9ac \ub85c\ub529 \ud6c4 \uc0ac\uc6a9\ud55c\ub2e4. NSString *fontPath = [[NSBundle mainBundle] pathForResource:@\"test\" ofType:@\"ttf\"]; CGDataProviderRef fontDataProvider = CGDataProviderCreateWithFilename([fontPath UTF8String]); CGFontRef _cgFont &hellip; Continue reading &rarr;","og_url":"https:\/\/apollo89.com\/wordpress\/?p=268","og_site_name":"Apollo89.com","article_published_time":"2009-04-22T17:11:52+00:00","article_modified_time":"2013-11-14T00:14:19+00:00","og_image":[{"url":"http:\/\/apollo89.com\/wordpress\/wp-content\/uploads\/1\/1341746382.png","type":"","width":"","height":""}],"author":"apollo89","twitter_card":"summary_large_image","twitter_misc":{"\uae00\uc4f4\uc774":"apollo89","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"1\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/apollo89.com\/wordpress\/?p=268#article","isPartOf":{"@id":"https:\/\/apollo89.com\/wordpress\/?p=268"},"author":{"name":"apollo89","@id":"https:\/\/apollo89.com\/wordpress\/#\/schema\/person\/93f56825cac3b2f18e5f107995066c82"},"headline":"iPhone\uc5d0\uc11c Custom font \uc4f0\ub294 \ubc95","datePublished":"2009-04-22T17:11:52+00:00","dateModified":"2013-11-14T00:14:19+00:00","mainEntityOfPage":{"@id":"https:\/\/apollo89.com\/wordpress\/?p=268"},"wordCount":30,"commentCount":0,"image":{"@id":"https:\/\/apollo89.com\/wordpress\/?p=268#primaryimage"},"thumbnailUrl":"http:\/\/apollo89.com\/wordpress\/wp-content\/uploads\/1\/1341746382.png","keywords":["\uc544\uc774\ud3f0","\ud3f0\ud2b8"],"articleSection":["Objective-C\/iPhone"],"inLanguage":"ko-KR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/apollo89.com\/wordpress\/?p=268#respond"]}]},{"@type":"WebPage","@id":"https:\/\/apollo89.com\/wordpress\/?p=268","url":"https:\/\/apollo89.com\/wordpress\/?p=268","name":"iPhone\uc5d0\uc11c Custom font \uc4f0\ub294 \ubc95 - Apollo89.com","isPartOf":{"@id":"https:\/\/apollo89.com\/wordpress\/#website"},"primaryImageOfPage":{"@id":"https:\/\/apollo89.com\/wordpress\/?p=268#primaryimage"},"image":{"@id":"https:\/\/apollo89.com\/wordpress\/?p=268#primaryimage"},"thumbnailUrl":"http:\/\/apollo89.com\/wordpress\/wp-content\/uploads\/1\/1341746382.png","datePublished":"2009-04-22T17:11:52+00:00","dateModified":"2013-11-14T00:14:19+00:00","author":{"@id":"https:\/\/apollo89.com\/wordpress\/#\/schema\/person\/93f56825cac3b2f18e5f107995066c82"},"breadcrumb":{"@id":"https:\/\/apollo89.com\/wordpress\/?p=268#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/apollo89.com\/wordpress\/?p=268"]}]},{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/apollo89.com\/wordpress\/?p=268#primaryimage","url":"http:\/\/apollo89.com\/wordpress\/wp-content\/uploads\/1\/1341746382.png","contentUrl":"http:\/\/apollo89.com\/wordpress\/wp-content\/uploads\/1\/1341746382.png"},{"@type":"BreadcrumbList","@id":"https:\/\/apollo89.com\/wordpress\/?p=268#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/apollo89.com\/wordpress"},{"@type":"ListItem","position":2,"name":"iPhone\uc5d0\uc11c Custom font \uc4f0\ub294 \ubc95"}]},{"@type":"WebSite","@id":"https:\/\/apollo89.com\/wordpress\/#website","url":"https:\/\/apollo89.com\/wordpress\/","name":"Apollo89.com","description":"\uc544\ud3f4\ub85c\uc528\uc758 \uc7a1\ub2e4\ud55c \uacbd\ud5d8\ub4e4..","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/apollo89.com\/wordpress\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Person","@id":"https:\/\/apollo89.com\/wordpress\/#\/schema\/person\/93f56825cac3b2f18e5f107995066c82","name":"apollo89","description":"\uc544\ud3f4\ub85c89 \uc785\ub2c8\ub2e4.","url":"https:\/\/apollo89.com\/wordpress\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/apollo89.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/268","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/apollo89.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/apollo89.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/apollo89.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/apollo89.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=268"}],"version-history":[{"count":0,"href":"https:\/\/apollo89.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/268\/revisions"}],"wp:attachment":[{"href":"https:\/\/apollo89.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/apollo89.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=268"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/apollo89.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}