{"id":297,"date":"2017-11-23T20:17:18","date_gmt":"2017-11-23T19:17:18","guid":{"rendered":"http:\/\/mikrocontroller.bplaced.net\/wordpress\/?page_id=297"},"modified":"2019-08-19T22:42:37","modified_gmt":"2019-08-19T20:42:37","slug":"08-lcd_font-library-stm32f429","status":"publish","type":"page","link":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/stm32f429\/komplette-library-liste-stm32f429\/08-lcd_font-library-stm32f429\/","title":{"rendered":"08-LCD_Font-Library (STM32F429)"},"content":{"rendered":"<p><div id=\"nav-below\" class=\"navigation\"><div class=\"nav-previous\"><a href=\"https:\/\/mikrocontroller.bplaced.net\/wordpress\/stm32f429\/komplette-library-liste-stm32f429\/07-lcd_ili9341-library-stm32f429\/\" title=\"07-LCD_ILI9341-Library (STM32F429)\"><span class=\"meta-nav\">\u2190<\/span> 07-LCD_ILI9341-Library (STM32F429)<\/a><\/div><\/div><!-- #nav-below --><div id=\"nav-below\" class=\"navigation\"><div class=\"nav-next\"><a href=\"https:\/\/mikrocontroller.bplaced.net\/wordpress\/stm32f429\/komplette-library-liste-stm32f429\/09-adc-single-conversation-stm32f429\/\" title=\"09-ADC-Single-Conversation (STM32F429)\">09-ADC-Single-Conversation (STM32F429) <span class=\"meta-nav\">&rarr;<\/span><\/a><\/div><\/div><!-- #nav-below --><\/p>\n<p>diese Library dient zum zeichnen von Texten auf dem LC-Display.<\/p>\n<p>sie ben\u00f6tigt dazu die LCD-Library \u201c<a href=\"http:\/\/mikrocontroller.bplaced.net\/wordpress\/?page_id=295\">STM32_UB_LCD_ILI9341<\/a>\u2033<br \/>\nund einen oder mehrere Font-Files die zus\u00e4tzlich eingebunden werden m\u00fcssen.<\/p>\n<p>in diesem Library sind mehrere Fonts dabei. Mit dem von mir geschriebenen PC-Programm \u201c<a href=\"http:\/\/mikrocontroller.bplaced.net\/wordpress\/?page_id=140#P01\">PixelFontGenerator<\/a>\u201d , k\u00f6nnen Windows-Fonts in das ben\u00f6tigte Format umgewandelt werden.<\/p>\n<p>Die breite vom Font kann max 32 Pixel sein und es sind monospaced und proportionale Fonts benutzbar.<\/p>\n<p><strong>Beispielbild :<\/strong><\/p>\n<p><a href=\"wp-content\/uploads\/2014\/07\/prop_font.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4067\" src=\"wp-content\/uploads\/2014\/07\/prop_font-179x300.jpg\" alt=\"prop_font\" width=\"179\" height=\"300\" \/><\/a><\/p>\n<p><strong>Funktionen :<\/strong><\/p>\n<pre lang=\"c\" line=\"1\">\/\/ fuer Monospaced-Fonts\r\nvoid UB_Font_DrawChar(uint16_t x, uint16_t y, uint8_t ascii, UB_Font *font, uint16_t vg, uint16_t bg);     \/\/ zum zeichnen eines Zeichens (max 16pixel breite)\r\nvoid UB_Font_DrawString(uint16_t x, uint16_t y,char *ptr, UB_Font *font, uint16_t vg, uint16_t bg);        \/\/ zum zeichnen eines Textes (max 16pixel breite)\r\nvoid UB_Font_DrawChar32(uint16_t x, uint16_t y, uint8_t ascii, UB_Font32 *font, uint16_t vg, uint16_t bg); \/\/ zum zeichnen eines Zeichens (max 32pixel breite)\r\nvoid UB_Font_DrawString32(uint16_t x, uint16_t y,char *ptr, UB_Font32 *font, uint16_t vg, uint16_t bg);    \/\/ zum zeichnen eines Textes (max 32pixel breite)\r\n\/\/ fuer Proportional-Fonts\r\nuint16_t UB_Font_DrawPChar(uint16_t x, uint16_t y, uint8_t ascii, UB_pFont *font, uint16_t vg, uint16_t bg);      \/\/ zum zeichnen eines Zeichens (max 16pixel breite)\r\nvoid UB_Font_DrawPString(uint16_t x, uint16_t y,char *ptr, UB_pFont *font, uint16_t vg, uint16_t bg);             \/\/ zum zeichnen eines Textes (max 16pixel breite)\r\nuint16_t UB_Font_DrawPChar32(uint16_t x, uint16_t y, uint8_t ascii, UB_pFont32 *font, uint16_t vg, uint16_t bg);  \/\/ zum zeichnen eines Zeichens (max 32pixel breite)\r\nvoid UB_Font_DrawPString32(uint16_t x, uint16_t y,char *ptr, UB_pFont32 *font, uint16_t vg, uint16_t bg);         \/\/ zum zeichnen eines Textes (max 32pixel breite)<\/pre>\n<p><strong>Beispiel :<\/strong><\/p>\n<pre lang=\"c\" line=\"1\">\/\/--------------------------------------------------------------\r\n\/\/ File     : main.c\r\n\/\/ Datum    : 26.07.2014\r\n\/\/ Version  : 1.2\r\n\/\/ Autor    : UB\r\n\/\/ EMail    : mc-4u(@)t-online.de\r\n\/\/ Web      : www.mikrocontroller-4u.de\r\n\/\/ CPU      : STM32F429\r\n\/\/ IDE      : CooCox CoIDE 1.7.4\r\n\/\/ GCC      : 4.7 2012q4\r\n\/\/ Module   : CMSIS_BOOT, M4_CMSIS_CORE\r\n\/\/ Funktion : Demo der Font-Library\r\n\/\/ Hinweis  : Diese zwei Files muessen auf 8MHz stehen\r\n\/\/              \"cmsis_boot\/stm32f4xx.h\"\r\n\/\/              \"cmsis_boot\/system_stm32f4xx.c\"\r\n\/\/ In Configuration diese Define hinzuf\u00fcgen :\r\n\/\/ \"STM32F429_439xx\" , \"__ASSEMBLY__\" , \"USE_STDPERIPH_DRIVER\"\r\n\/\/--------------------------------------------------------------\r\n\r\n#include \"main.h\"\r\n#include \"stm32_ub_lcd_ili9341.h\"\r\n#include \"stm32_ub_font.h\"\r\n\r\nint main(void)\r\n{\r\n  SystemInit(); \/\/ Quarz Einstellungen aktivieren\r\n\r\n  \/\/ Init vom LCD\r\n  UB_LCD_Init();\r\n  \/\/ Init der Layer\r\n  UB_LCD_LayerInit_Fullscreen();\r\n  \/\/ auf Hintergrund schalten\r\n  UB_LCD_SetLayer_1();\r\n  \/\/ Hintergrund komplett mit einer Farbe f\u00fcllen\r\n  UB_LCD_FillLayer(RGB_COL_WHITE);\r\n  \/\/ auf Vordergrund schalten\r\n  UB_LCD_SetLayer_2();\r\n  \/\/ Vordergrund komplett mit einer Farbe f\u00fcllen\r\n  UB_LCD_FillLayer(RGB_COL_GREEN);\r\n\r\n  \/\/ schwarzen Text auf weisem Grund zeichnen mit verschiedenen Fonts\r\n  UB_Font_DrawString(10,10,\"Arial-7x10\",&amp;Arial_7x10,RGB_COL_BLACK,RGB_COL_WHITE);\r\n  UB_Font_DrawString(10,30,\"Arial-8x13\",&amp;Arial_8x13,RGB_COL_BLACK,RGB_COL_WHITE);\r\n  UB_Font_DrawString(10,50,\"Arial-10x15\",&amp;Arial_10x15,RGB_COL_BLACK,RGB_COL_WHITE);\r\n  UB_Font_DrawString(10,70,\"Arial-11x18\",&amp;Arial_11x18,RGB_COL_BLACK,RGB_COL_WHITE);\r\n  UB_Font_DrawString(10,100,\"Arial-13x19\",&amp;Arial_13x19,RGB_COL_BLACK,RGB_COL_WHITE);\r\n  UB_Font_DrawString(10,130,\"Arial-14x22\",&amp;Arial_14x22,RGB_COL_BLACK,RGB_COL_WHITE);\r\n  UB_Font_DrawString(10,160,\"Arial-16x25\",&amp;Arial_16x25,RGB_COL_BLACK,RGB_COL_WHITE);\r\n  \/\/ 32 Bit Font\r\n  UB_Font_DrawString32(10,190,\"Arial-18x27\",&amp;Arial_18x27,RGB_COL_BLACK,RGB_COL_WHITE);\r\n  \/\/ Proportional Font\r\n  UB_Font_DrawPString(10,220,\"Times 15 (proportional)\",&amp;pTimes_15,RGB_COL_BLACK,RGB_COL_WHITE);\r\n  \/\/ 32 Bit Proportional\r\n  UB_Font_DrawPString32(10,240,\"Times 18 (proportional)\",&amp;pTimes_18,RGB_COL_BLACK,RGB_COL_WHITE);\r\n\r\n  while(1)\r\n  {\r\n\r\n  }\r\n}\r\n<\/pre>\n<p>Hier die Library zum\u00a0<strong>Download :<\/strong><\/p>\n<p><a href=\"wp-content\/uploads\/2014\/07\/lcd_font_f429_v101.zip\">lcd_font_f429_v101<\/a><\/p>\n<p>Hier der komplette CooCox-Projektordner zum\u00a0<strong>Download :<\/strong><\/p>\n<p><a href=\"wp-content\/uploads\/2014\/07\/Demo_F429_08.zip\">Demo_F429_08<\/a><\/p>\n<p>Hier der Link zu dem PC-Programm :<\/p>\n<p><a title=\"PC-Programme von mir\" href=\"http:\/\/mikrocontroller.bplaced.net\/wordpress\/?page_id=140\">PC-Programme<\/a><\/p>\n<hr \/>\n<h3 id=\"comments-title\">7 Antworten auf <em>08-LCD_Font-Library (STM32F429)<\/em><\/h3>\n<ol class=\"commentlist\">\n<li id=\"li-comment-2015\" class=\"comment even thread-even depth-1\">\n<div id=\"comment-2015\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/1.gravatar.com\/avatar\/9f90316e2e6f38508fc533cbd9122f5c?s=40&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\">Leo<\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">6. August 2014 um 14:26<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>excellent library. thank you so much. works well with all languages \u200b\u200b(Russian, Ukrainian).<br \/>\n\u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430. \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u0441\u043f\u0430\u0441\u0438\u0431\u043e. \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u044f\u0437\u044b\u043a\u0430\u043c\u0438 (\u0440\u0443\u0441\u0441\u043a\u0438\u0439, \u0443\u043a\u0440\u0430\u0438\u043d\u0441\u043a\u0438\u0439. \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u043d\u044b\u0439 \u0448\u0440\u0438\u0444\u0442)<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/li>\n<li id=\"li-comment-3080\" class=\"comment odd alt thread-odd thread-alt depth-1\">\n<div id=\"comment-3080\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/1.gravatar.com\/avatar\/bf30e169224e064a88f9720cdf86d608?s=40&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\">Ryan<\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">5. April 2015 um 08:07<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>Hello UB, I would like to use special characters such as: \u201c\u00c1\u201d, \u201c\u00e9\u201d, \u201c\u00f4\u201d\u2026.<br \/>\nI tried using \\220 \\202 \u2026 but does not work, how I could show them on my LCD?<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/p>\n<ul class=\"children\">\n<li id=\"li-comment-3083\" class=\"comment byuser comment-author-admin_ub bypostauthor even depth-2\">\n<div id=\"comment-3083\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/0.gravatar.com\/avatar\/67426419ead44d5afa132e92685bb460?s=40&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\">admin_ub<\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">5. April 2015 um 09:33<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>the simplest way is to generate a font with ascii 32 \u2013 255 . so you have a \u201ctemplate\u201d with all characters. To do this you must check \u201cextended ascii\u201d and set the \u201clast character\u201d to 255. Then choose a font press autoset and generate the font last. Now the font should have implemented the \u201cspecial chars\u201d.<br \/>\nHere you can check which ascii-nr you needed to draw these characters.<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/p>\n<ul class=\"children\">\n<li id=\"li-comment-3084\" class=\"comment odd alt depth-3\">\n<div id=\"comment-3084\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/1.gravatar.com\/avatar\/bf30e169224e064a88f9720cdf86d608?s=40&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\">Ryan<\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">6. April 2015 um 04:48<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>Thank you for help again. It worked perfectly!<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li id=\"li-comment-4635\" class=\"comment even thread-even depth-1\">\n<div id=\"comment-4635\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/1.gravatar.com\/avatar\/7480fd547837959153f35393ad53d4b1?s=40&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\">Alexandr<\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">7. M\u00e4rz 2016 um 19:36<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>Tell me please, how do you know which library nuzhn\u0456 from stm407vg and which by stm429-disco?<br \/>\nThanks<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/li>\n<li id=\"li-comment-4991\" class=\"comment odd alt thread-odd thread-alt depth-1\">\n<div id=\"comment-4991\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/1.gravatar.com\/avatar\/1a3f7a60c68e07bffed9448be653b00a?s=40&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\">Armin<\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">7. April 2017 um 21:45<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>Hallo!<\/p>\n<p>Ich verwende die Font-Library f\u00fcr mein STM32F7 und es funktioniert wirklich hervorragend!<\/p>\n<p>Leider brauch ich gr\u00f6\u00dfere Buchstaben als die Arial 18\u00d727. Ich konnte mit dem Font-Generator auch schon eine Arial-Schriftart in Gr\u00f6\u00dfe 36 erstellen und einbinden \u2013 leider auch zu klein. Seltsamerweise funktioniert es mit Gr\u00f6\u00dfe 48 nicht mehr (Erzeugen des Strings funktioniert nicht mehr auf dem Display, es wird kein Buchstabe angezeigt).<br \/>\nLiegt das an der 32pxl Beschr\u00e4nkung? Was m\u00fcsste ich denn ab\u00e4ndern, damit ich Schriftgr\u00f6\u00dfe 48 und mehr verwenden kann?<\/p>\n<p>Viele Gr\u00fc\u00dfe!<br \/>\nArmin<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/p>\n<ul class=\"children\">\n<li id=\"li-comment-4993\" class=\"comment even depth-2\">\n<div id=\"comment-4993\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/1.gravatar.com\/avatar\/1a3f7a60c68e07bffed9448be653b00a?s=40&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\">Armin<\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">10. April 2017 um 19:51<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>Konnte das Problem mittlerweile selbst l\u00f6sen, indem ich die Gr\u00f6\u00dfe der Buchstaben im Generator angepasst hab!<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>diese Library dient zum zeichnen von Texten auf dem LC-Display. sie ben\u00f6tigt dazu die LCD-Library \u201cSTM32_UB_LCD_ILI9341\u2033 und einen oder mehrere Font-Files die zus\u00e4tzlich eingebunden werden m\u00fcssen. in diesem Library sind mehrere Fonts dabei. Mit dem von mir geschriebenen PC-Programm \u201cPixelFontGenerator\u201d &hellip; <a href=\"https:\/\/mikrocontroller.bplaced.net\/wordpress\/stm32f429\/komplette-library-liste-stm32f429\/08-lcd_font-library-stm32f429\/\">Weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"parent":160,"menu_order":8,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[129],"tags":[142,139,9,102],"class_list":["post-297","page","type-page","status-publish","hentry","category-stm32f429","tag-font","tag-lcd","tag-library","tag-stm32f429"],"_links":{"self":[{"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-json\/wp\/v2\/pages\/297","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-json\/wp\/v2\/comments?post=297"}],"version-history":[{"count":8,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-json\/wp\/v2\/pages\/297\/revisions"}],"predecessor-version":[{"id":2637,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-json\/wp\/v2\/pages\/297\/revisions\/2637"}],"up":[{"embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-json\/wp\/v2\/pages\/160"}],"wp:attachment":[{"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-json\/wp\/v2\/media?parent=297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-json\/wp\/v2\/categories?post=297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-json\/wp\/v2\/tags?post=297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}