Wednesday, April 25th 2018, 6:54am UTC+2

You are not logged in.

  • Login
  • Register

annappa

Beginner

Date of registration: Mar 9th 2018

Posts: 2

1

Friday, March 9th 2018, 1:17pm

How to display "Δ" Symbol using emwin

Please let me know how to display special symbols using emwin , i want to display "Δ" :)

annappa

Beginner

Date of registration: Mar 9th 2018

Posts: 2

2

Tuesday, March 13th 2018, 5:10am

RE: How to display "Δ" Symbol using emwin

Please let me know how to display special symbols using emwin , i want to display "Δ" :)
;)

SEGGER - Schoenen

Super Moderator

Date of registration: Aug 13th 2015

Posts: 562

3

Tuesday, March 20th 2018, 4:17pm

Hi,

1. You need a font which contains the desired character (the default fonts do not contain this character so you have to create one with the Font Converter).

2. Convert the string into a UTF8 string. For the "Δ" character it is "\xce\x94". To generate it on your own create a UTF8 decoded txt file and paste the desired string into it. Then convert the txt file with U2C.exe into a c file. It will contain the UTF8 encoded "c"-string.

3. In your application enable UTF8 encoding by a call of GUI_UC_SetEncodeUTF8(), set the font with the character and display the UTF8 string.

Here is a short example how this can be achieved:

C/C++ Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#include "DIALOG.h"

/*********************************************************************
*
*   	Defines
*
**********************************************************************
*/
/*********************************************************************
*
*   	Static data
*
**********************************************************************
*/
/* Start of unicode area <Basic Greek> */
GUI_CONST_STORAGE unsigned char acGUI_FontDelta_0394[666] = { /* code 0394, GREEK CAPITAL LETTER DELTA */
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0xFF, 0xFF, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9F, 0xFF, 0xFF, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xF2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0xFF, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0xFF, 0xFC, 0xFF, 0xFD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xF3, 0xFF, 0xFF, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9F, 0xFF, 0xD0, 0xBF, 0xFF, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x80, 0x6F, 0xFF, 0xF1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0x20, 0x1F, 0xFF, 0xF6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0xFF, 0xFB, 0x00, 0x0A, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x2F, 0xFF, 0xF4, 0x00, 0x04, 0xFF, 0xFF, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x8F, 0xFF, 0xE0, 0x00, 0x00, 0xDF, 0xFF, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x90, 0x00, 0x00, 0x8F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x05, 0xFF, 0xFF, 0x30, 0x00, 0x00, 0x3F, 0xFF, 0xF6, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x0B, 0xFF, 0xFD, 0x00, 0x00, 0x00, 0x0D, 0xFF, 0xFB, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x2F, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x08, 0xFF, 0xFF, 0x20, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xF3, 0x00, 0x00, 0x00, 0x02, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0xDF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xCF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0x70, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xF5, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x0A, 0xFF, 0xFF, 0x20, 0x00, 0x00, 0x00, 0x00, 0x2F, 0xFF, 0xFB, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0xFF, 0xFF, 0x20, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x7F, 0xFF, 0xF6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0x70, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0xCF, 0xFF, 0xF1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xD0, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x03, 0xFF, 0xFF, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAF, 0xFF, 0xF4, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x09, 0xFF, 0xFF, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0xFF, 0xFA, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x1E, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0xFF, 0xFF, 0x10, 0x00, 0x00,
  0x00, 0x00, 0x6F, 0xFF, 0xFA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0xFF, 0xFF, 0x60, 0x00, 0x00,
  0x00, 0x00, 0xCF, 0xFF, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0xC0, 0x00, 0x00,
  0x00, 0x03, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0xF3, 0x00, 0x00,
  0x00, 0x09, 0xFF, 0xFF, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8F, 0xFF, 0xF9, 0x00, 0x00,
  0x00, 0x0E, 0xFF, 0xFF, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFE, 0x00, 0x00,
  0x00, 0x5F, 0xFF, 0xFD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0xFF, 0xFF, 0x50, 0x00,
  0x00, 0xBF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xFF, 0xFF, 0xB0, 0x00,
  0x02, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF2, 0x00,
  0x08, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00,
  0x0E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00,
  0x4F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x40
};

GUI_CONST_STORAGE GUI_CHARINFO_EXT GUI_FontDelta_CharInfo[1] = {
   {  35,  37,  -1,  11,  35, acGUI_FontDelta_0394 } /* code 0394, GREEK CAPITAL LETTER DELTA */
};

GUI_CONST_STORAGE GUI_FONT_PROP_EXT GUI_FontDelta_Prop1 = {
   0x0394 /* first character */
  ,0x0394 /* last character  */
  ,&GUI_FontDelta_CharInfo[  0] /* address of first character */
  ,(GUI_CONST_STORAGE GUI_FONT_PROP_EXT *)0 /* pointer to next GUI_FONT_PROP_EXT */
};

GUI_CONST_STORAGE GUI_FONT GUI_FontDelta = {
   GUI_FONTTYPE_PROP_AA4_EXT /* type of font	*/
  ,60 /* height of font  */
  ,60 /* space of font y */
  ,1 /* magnification x */
  ,1 /* magnification y */
  ,{&GUI_FontDelta_Prop1}
  ,48 /* Baseline */
  ,28 /* Height of lowercase characters */
  ,37 /* Height of capital characters */
};
/*********************************************************************
*
*   	Static code
*
**********************************************************************
*/
/*********************************************************************
*
*   	Public code
*
**********************************************************************
*/
/*********************************************************************
*
*   	MainTask
*/
void MainTask(void) {
  GUI_Init();
  GUI_UC_SetEncodeUTF8();
  GUI_SetFont(&GUI_FontDelta);
  GUI_DispString("\xce\x94");
  while (1) {
	GUI_Delay(100);
  }
}

/*************************** End of file ****************************/


Regards
Sven