{"id":28825,"date":"2023-01-03T09:52:18","date_gmt":"2023-01-03T04:22:18","guid":{"rendered":"https:\/\/jassweb.com\/solved\/solved-retrieve-graphical-representation-of-an-alphabet-letter\/"},"modified":"2023-01-03T09:52:18","modified_gmt":"2023-01-03T04:22:18","slug":"solved-retrieve-graphical-representation-of-an-alphabet-letter","status":"publish","type":"post","link":"https:\/\/jassweb.com\/solved\/solved-retrieve-graphical-representation-of-an-alphabet-letter\/","title":{"rendered":"[Solved] Retrieve graphical representation of an alphabet letter"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div id=\"answer-47360666\" class=\"answer js-answer accepted-answer js-accepted-answer\" data-answerid=\"47360666\" data-parentid=\"47328262\" data-score=\"0\" data-position-on-page=\"1\" data-highest-scored=\"1\" data-question-has-accepted-highest-score=\"1\" itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n<div class=\"post-layout\">\n<div class=\"votecell post-layout--left\"><\/div>\n<div class=\"answercell post-layout--right\">\n<div class=\"s-prose js-post-body\" itemprop=\"text\">\n<p>Here&#8217;s another way that returns Points:<\/p>\n<pre><code>private void textStuff() {\n    int textSize = 32;\n    char letter=\"A\";\n    getPointsForChar(textSize, letter);\n}\n\n@NonNull\nprivate ArrayList&lt;Point&gt; getPointsForChar(int textSize, char letter) {\n    Canvas canvas = new Canvas();\n    Paint paint = new Paint();\n    Bitmap bitmap = Bitmap.createBitmap((int) (float) textSize, (int) (float) textSize, Bitmap.Config.ALPHA_8);\n    canvas.drawPaint(paint);\n    canvas.setBitmap(bitmap);\n    paint.setColor(Color.BLACK);\n    paint.setTextSize(textSize);\n    canvas.drawText(String.valueOf(letter), 0, (float) textSize, paint);\n    Log.d(\"Font\", \"bitmap \" + bitmap.toString());\n    ArrayList&lt;Point&gt; points = new ArrayList&lt;&gt;();\n    for (int x = 0; x &lt; bitmap.getWidth(); x++) {\n        for (int y = 0; y &lt; bitmap.getHeight(); y++) {\n            int pixel = bitmap.getPixel(x, y);\n            if (pixel != Color.TRANSPARENT) {\n                points.add(new Point(x, y));\n            }\n        }\n    }\n\n    StringBuilder stringBuilder = new StringBuilder(\"The following points make up '\" + letter + \"':\");\n    for (Point point : points) {\n        stringBuilder.append(\"\\n\\t\").append(point.toString()).append(\", \");\n    }\n\n    Log.d(\"Font\", stringBuilder.toString());\n    return points;\n}\n<\/code><\/pre>\n<p>The output of the above method is:<\/p>\n<pre><code>The following points make up 'A':\n    Point(1, 29),\n    Point(1, 30),\n    Point(1, 31),\n    Point(2, 27),\n    Point(2, 28),\n    Point(2, 29),\n    Point(2, 30),\n    Point(2, 31),\n    Point(3, 24),\n    Point(3, 25),\n    Point(3, 26),\n    Point(3, 27),\n    Point(3, 28),\n    Point(3, 29),\n    Point(3, 30),\n    Point(3, 31),\n    Point(4, 22),\n    Point(4, 23),\n    Point(4, 24),\n    Point(4, 25),\n    Point(4, 26),\n    Point(4, 27),\n    Point(4, 28),\n    Point(5, 19),\n    Point(5, 20),\n    Point(5, 21),\n    Point(5, 22),\n    Point(5, 23),\n    Point(5, 24),\n    Point(5, 25),\n    Point(5, 26),\n    Point(6, 17),\n    Point(6, 18),\n    Point(6, 19),\n    Point(6, 20),\n    Point(6, 21),\n    Point(6, 22),\n    Point(6, 23),\n    Point(6, 24),\n    Point(6, 25),\n    Point(7, 14),\n    Point(7, 15),\n    Point(7, 16),\n    Point(7, 17),\n    Point(7, 18),\n    Point(7, 19),\n    Point(7, 20),\n    Point(7, 21),\n    Point(7, 24),\n    Point(7, 25),\n    Point(8, 12),\n    Point(8, 13),\n    Point(8, 14),\n    Point(8, 15),\n    Point(8, 16),\n    Point(8, 17),\n    Point(8, 18),\n    Point(8, 24),\n    Point(8, 25),\n    Point(9, 10),\n    Point(9, 11),\n    Point(9, 12),\n    Point(9, 13),\n    Point(9, 14),\n    Point(9, 15),\n    Point(9, 24),\n    Point(9, 25),\n    Point(10, 10),\n    Point(10, 11),\n    Point(10, 12),\n    Point(10, 13),\n    Point(10, 24),\n    Point(10, 25),\n    Point(11, 10),\n    Point(11, 11),\n    Point(11, 12),\n    Point(11, 13),\n    Point(11, 14),\n    Point(11, 15),\n    Point(11, 24),\n    Point(11, 25),\n    Point(12, 12),\n    Point(12, 13),\n    Point(12, 14),\n    Point(12, 15),\n    Point(12, 16),\n    Point(12, 17),\n    Point(12, 18),\n    Point(12, 24),\n    Point(12, 25),\n    Point(13, 14),\n    Point(13, 15),\n    Point(13, 16),\n    Point(13, 17),\n    Point(13, 18),\n    Point(13, 19),\n    Point(13, 20),\n    Point(13, 21),\n    Point(13, 24),\n    Point(13, 25),\n    Point(14, 17),\n    Point(14, 18),\n    Point(14, 19),\n    Point(14, 20),\n    Point(14, 21),\n    Point(14, 22),\n    Point(14, 23),\n    Point(14, 24),\n    Point(14, 25),\n    Point(15, 19),\n    Point(15, 20),\n    Point(15, 21),\n    Point(15, 22),\n    Point(15, 23),\n    Point(15, 24),\n    Point(15, 25),\n    Point(15, 26),\n    Point(16, 22),\n    Point(16, 23),\n    Point(16, 24),\n    Point(16, 25),\n    Point(16, 26),\n    Point(16, 27),\n    Point(16, 28),\n    Point(16, 29),\n    Point(17, 24),\n    Point(17, 25),\n    Point(17, 26),\n    Point(17, 27),\n    Point(17, 28),\n    Point(17, 29),\n    Point(17, 30),\n    Point(17, 31),\n    Point(18, 27),\n    Point(18, 28),\n    Point(18, 29),\n    Point(18, 30),\n    Point(18, 31),\n    Point(19, 30),\n    Point(19, 31),\n<\/code><\/pre>\n<\/p><\/div>\n<div class=\"mt24\"><\/div>\n<\/div>\n<p>            <span class=\"d-none\" itemprop=\"commentCount\">2<\/span> <\/p><\/div>\n<\/div>\n<p>[ad_2]<\/p>\n<p>solved Retrieve graphical representation of an alphabet letter <\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] Here&#8217;s another way that returns Points: private void textStuff() { int textSize = 32; char letter=&#8221;A&#8221;; getPointsForChar(textSize, letter); } @NonNull private ArrayList&lt;Point&gt; getPointsForChar(int textSize, char letter) { Canvas canvas = new Canvas(); Paint paint = new Paint(); Bitmap bitmap = Bitmap.createBitmap((int) (float) textSize, (int) (float) textSize, Bitmap.Config.ALPHA_8); canvas.drawPaint(paint); canvas.setBitmap(bitmap); paint.setColor(Color.BLACK); paint.setTextSize(textSize); canvas.drawText(String.valueOf(letter), 0, (float) &#8230; <a title=\"[Solved] Retrieve graphical representation of an alphabet letter\" class=\"read-more\" href=\"https:\/\/jassweb.com\/solved\/solved-retrieve-graphical-representation-of-an-alphabet-letter\/\" aria-label=\"More on [Solved] Retrieve graphical representation of an alphabet letter\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[452],"class_list":["post-28825","post","type-post","status-publish","format-standard","hentry","category-solved","tag-android"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>[Solved] Retrieve graphical representation of an alphabet letter - JassWeb<\/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:\/\/jassweb.com\/solved\/solved-retrieve-graphical-representation-of-an-alphabet-letter\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Solved] Retrieve graphical representation of an alphabet letter - JassWeb\" \/>\n<meta property=\"og:description\" content=\"[ad_1] Here&#8217;s another way that returns Points: private void textStuff() { int textSize = 32; char letter=&quot;A&quot;; getPointsForChar(textSize, letter); } @NonNull private ArrayList&lt;Point&gt; getPointsForChar(int textSize, char letter) { Canvas canvas = new Canvas(); Paint paint = new Paint(); Bitmap bitmap = Bitmap.createBitmap((int) (float) textSize, (int) (float) textSize, Bitmap.Config.ALPHA_8); canvas.drawPaint(paint); canvas.setBitmap(bitmap); paint.setColor(Color.BLACK); paint.setTextSize(textSize); canvas.drawText(String.valueOf(letter), 0, (float) ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jassweb.com\/solved\/solved-retrieve-graphical-representation-of-an-alphabet-letter\/\" \/>\n<meta property=\"og:site_name\" content=\"JassWeb\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-03T04:22:18+00:00\" \/>\n<meta name=\"author\" content=\"Kirat\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kirat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-retrieve-graphical-representation-of-an-alphabet-letter\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-retrieve-graphical-representation-of-an-alphabet-letter\\\/\"},\"author\":{\"name\":\"Kirat\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/person\\\/65c9c7b7958150c0dc8371fa35dd7c31\"},\"headline\":\"[Solved] Retrieve graphical representation of an alphabet letter\",\"datePublished\":\"2023-01-03T04:22:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-retrieve-graphical-representation-of-an-alphabet-letter\\\/\"},\"wordCount\":32,\"publisher\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#organization\"},\"keywords\":[\"android\"],\"articleSection\":[\"Solved\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-retrieve-graphical-representation-of-an-alphabet-letter\\\/\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-retrieve-graphical-representation-of-an-alphabet-letter\\\/\",\"name\":\"[Solved] Retrieve graphical representation of an alphabet letter - JassWeb\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#website\"},\"datePublished\":\"2023-01-03T04:22:18+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-retrieve-graphical-representation-of-an-alphabet-letter\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-retrieve-graphical-representation-of-an-alphabet-letter\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-retrieve-graphical-representation-of-an-alphabet-letter\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Solved] Retrieve graphical representation of an alphabet letter\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#website\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/\",\"name\":\"JassWeb\",\"description\":\"Build High-quality Websites\",\"publisher\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#organization\",\"name\":\"Jass Web\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/jassweb.com\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/jass-website-logo-1.png\",\"contentUrl\":\"https:\\\/\\\/jassweb.com\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/jass-website-logo-1.png\",\"width\":693,\"height\":132,\"caption\":\"Jass Web\"},\"image\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/person\\\/65c9c7b7958150c0dc8371fa35dd7c31\",\"name\":\"Kirat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/wp-content\\\/litespeed\\\/avatar\\\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/wp-content\\\/litespeed\\\/avatar\\\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400\",\"contentUrl\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/wp-content\\\/litespeed\\\/avatar\\\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400\",\"caption\":\"Kirat\"},\"sameAs\":[\"http:\\\/\\\/jassweb.com\"],\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/author\\\/jaspritsinghghumangmail-com\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Solved] Retrieve graphical representation of an alphabet letter - JassWeb","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:\/\/jassweb.com\/solved\/solved-retrieve-graphical-representation-of-an-alphabet-letter\/","og_locale":"en_US","og_type":"article","og_title":"[Solved] Retrieve graphical representation of an alphabet letter - JassWeb","og_description":"[ad_1] Here&#8217;s another way that returns Points: private void textStuff() { int textSize = 32; char letter=\"A\"; getPointsForChar(textSize, letter); } @NonNull private ArrayList&lt;Point&gt; getPointsForChar(int textSize, char letter) { Canvas canvas = new Canvas(); Paint paint = new Paint(); Bitmap bitmap = Bitmap.createBitmap((int) (float) textSize, (int) (float) textSize, Bitmap.Config.ALPHA_8); canvas.drawPaint(paint); canvas.setBitmap(bitmap); paint.setColor(Color.BLACK); paint.setTextSize(textSize); canvas.drawText(String.valueOf(letter), 0, (float) ... Read more","og_url":"https:\/\/jassweb.com\/solved\/solved-retrieve-graphical-representation-of-an-alphabet-letter\/","og_site_name":"JassWeb","article_published_time":"2023-01-03T04:22:18+00:00","author":"Kirat","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kirat","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jassweb.com\/solved\/solved-retrieve-graphical-representation-of-an-alphabet-letter\/#article","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/solved-retrieve-graphical-representation-of-an-alphabet-letter\/"},"author":{"name":"Kirat","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31"},"headline":"[Solved] Retrieve graphical representation of an alphabet letter","datePublished":"2023-01-03T04:22:18+00:00","mainEntityOfPage":{"@id":"https:\/\/jassweb.com\/solved\/solved-retrieve-graphical-representation-of-an-alphabet-letter\/"},"wordCount":32,"publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"keywords":["android"],"articleSection":["Solved"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jassweb.com\/solved\/solved-retrieve-graphical-representation-of-an-alphabet-letter\/","url":"https:\/\/jassweb.com\/solved\/solved-retrieve-graphical-representation-of-an-alphabet-letter\/","name":"[Solved] Retrieve graphical representation of an alphabet letter - JassWeb","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/#website"},"datePublished":"2023-01-03T04:22:18+00:00","breadcrumb":{"@id":"https:\/\/jassweb.com\/solved\/solved-retrieve-graphical-representation-of-an-alphabet-letter\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jassweb.com\/solved\/solved-retrieve-graphical-representation-of-an-alphabet-letter\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jassweb.com\/solved\/solved-retrieve-graphical-representation-of-an-alphabet-letter\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jassweb.com\/solved\/"},{"@type":"ListItem","position":2,"name":"[Solved] Retrieve graphical representation of an alphabet letter"}]},{"@type":"WebSite","@id":"https:\/\/jassweb.com\/solved\/#website","url":"https:\/\/jassweb.com\/solved\/","name":"JassWeb","description":"Build High-quality Websites","publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jassweb.com\/solved\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jassweb.com\/solved\/#organization","name":"Jass Web","url":"https:\/\/jassweb.com\/solved\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/","url":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","contentUrl":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","width":693,"height":132,"caption":"Jass Web"},"image":{"@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31","name":"Kirat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400","url":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400","contentUrl":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400","caption":"Kirat"},"sameAs":["http:\/\/jassweb.com"],"url":"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/28825","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/comments?post=28825"}],"version-history":[{"count":0,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/28825\/revisions"}],"wp:attachment":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/media?parent=28825"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/categories?post=28825"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/tags?post=28825"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}