硬汉嵌入式论坛

 找回密码
 立即注册
查看: 2402|回复: 5
收起左侧

[emWin] emwin怎么显示角度符号等特殊字符?

[复制链接]

45

主题

70

回帖

205

积分

高级会员

积分
205
发表于 2019-6-27 15:31:41 | 显示全部楼层 |阅读模式
有什么简单方法显示角度符号吗?
postion.JPG
回复

使用道具 举报

23

主题

1443

回帖

1512

积分

至尊会员

积分
1512
发表于 2019-6-27 15:48:09 | 显示全部楼层
你电脑自带字体能显示就OK,然后使用fontcvt转换生成
代码不规范,亲人两行泪!
回复

使用道具 举报

11

主题

130

回帖

168

积分

初级会员

积分
168
发表于 2019-6-27 16:33:49 | 显示全部楼层
GUI_DispString("\xb0");这样就可以
回复

使用道具 举报

23

主题

1443

回帖

1512

积分

至尊会员

积分
1512
发表于 2019-6-27 16:41:12 | 显示全部楼层
有梦为马 发表于 2019-6-27 16:33
GUI_DispString("\xb0");这样就可以

这个要指定非ASCII字体才行吧,大佬
QQ截图20190627163923.jpg
代码不规范,亲人两行泪!
回复

使用道具 举报

9

主题

113

回帖

145

积分

初级会员

积分
145
发表于 2019-6-28 18:07:59 | 显示全部楼层
内置字体太丑,还不支持抗锯齿
回复

使用道具 举报

45

主题

70

回帖

205

积分

高级会员

积分
205
 楼主| 发表于 2019-7-2 15:28:17 | 显示全部楼层
  1. void display_latitude(struct minmea_position *latitude, int x0 , int y0)
  2. {
  3.        
  4.         char degree_buf[3],minute_buf[7];
  5.         rt_memset(latitude_buf,0,12);
  6.         rt_sprintf(degree_buf,"%d",latitude->degrees);
  7.         sprintf(minute_buf,"%5.3f",latitude->minutes);
  8.        
  9.         rt_strncpy(latitude_buf,degree_buf,2);
  10.         strcat(latitude_buf,"\xb0");
  11.         strcat(latitude_buf,minute_buf);
  12.         strcat(latitude_buf," ");
  13.         strncat(latitude_buf,&latitude->direction,1);
  14.         GUI_SetFont(&GUI_Font16B_1);
  15.         GUI_DispStringAt(latitude_buf, x0, y0);
  16. }
复制代码

感谢各位解答,最简单的做法是上边那种。想要好看的,可以生成抗锯齿字体吧。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2025-5-18 03:12 , Processed in 0.245635 second(s), 26 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表