中英文字符对齐

This commit is contained in:
wu58430 2023-12-17 18:27:47 +08:00
parent e50e8f9c51
commit 0c90f65906
4 changed files with 31 additions and 65 deletions

View file

@ -20,12 +20,7 @@
</configurations>
</component>
<component name="ChangeListManager">
<list default="true" id="cea36e80-e289-4d69-9030-7186d540ac0e" name="更改" comment="赞助">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/functions.c" beforeDir="false" afterPath="$PROJECT_DIR$/functions.c" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ui/main.c" beforeDir="false" afterPath="$PROJECT_DIR$/ui/main.c" afterDir="false" />
<change beforePath="$PROJECT_DIR$/version.c" beforeDir="false" afterPath="$PROJECT_DIR$/version.c" afterDir="false" />
</list>
<list default="true" id="cea36e80-e289-4d69-9030-7186d540ac0e" name="更改" comment="110" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@ -220,14 +215,7 @@
<workItem from="1702173911297" duration="1180000" />
<workItem from="1702175521208" duration="2000" />
<workItem from="1702774207484" duration="5418000" />
<workItem from="1702793061935" duration="4131000" />
</task>
<task id="LOCAL-00038" summary="MDC RX">
<created>1701690210457</created>
<option name="number" value="00038" />
<option name="presentableId" value="LOCAL-00038" />
<option name="project" value="LOCAL" />
<updated>1701690210457</updated>
<workItem from="1702793061935" duration="4377000" />
</task>
<task id="LOCAL-00039" summary="MDC RX">
<created>1701690633183</created>
@ -565,7 +553,14 @@
<option name="project" value="LOCAL" />
<updated>1702793183141</updated>
</task>
<option name="localTasksCounter" value="87" />
<task id="LOCAL-00087" summary="110">
<created>1702798230173</created>
<option name="number" value="00087" />
<option name="presentableId" value="LOCAL-00087" />
<option name="project" value="LOCAL" />
<updated>1702798230173</updated>
</task>
<option name="localTasksCounter" value="88" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@ -592,7 +587,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="fix https://github.com/losehu/uv-k5-firmware-chinese/issues/4" />
<MESSAGE value="修复切换调制模式时亚音消失问题" />
<MESSAGE value="按键锁定改回以前逻辑" />
<MESSAGE value="mdc tx end test" />
@ -617,6 +611,7 @@
<MESSAGE value="MDC联系人" />
<MESSAGE value="MDC PY" />
<MESSAGE value="赞助" />
<option name="LAST_COMMIT_MESSAGE" value="赞助" />
<MESSAGE value="110" />
<option name="LAST_COMMIT_MESSAGE" value="110" />
</component>
</project>

View file

@ -110,11 +110,15 @@ void UI_PrintStringSmall(const char *pString, uint8_t Start, uint8_t End, uint8_
size_t i;
uint8_t sum_pixel = 0;
uint8_t chn_flag[Length];
bool flag_move = 0;
for (size_t j = 0; j < Length; j++) {
chn_flag[j] = is_chn(pString[j]);
if (chn_flag[j] == 255 && pString[j] != '\n' && pString[j] != '\0')sum_pixel += 7;
else if (chn_flag[j] != 255)sum_pixel += 12;
else if (chn_flag[j] != 255) {
flag_move = 1;
sum_pixel += 12;
}
}
if (End > Start)
@ -128,6 +132,18 @@ void UI_PrintStringSmall(const char *pString, uint8_t Start, uint8_t End, uint8_
if (pString[i] > ' ') {
const unsigned int index = (unsigned int) pString[i] - ' ' - 1;
if (index < ARRAY_SIZE(gFontSmall)) {
if (flag_move) {
uint8_t gFontSmall_More[12] = {0};
for (int j = 0; j < 12; ++j) {
if (j < 6) {
gFontSmall_More[j] = (gFontSmall[index][j] & 31) << 3;//00011111
} else {
gFontSmall_More[j] = (gFontSmall[index][j - 6] & 224) >> 5;//11100000
}
}
memcpy(pFb + now_pixel + 1, &gFontSmall_More[0], 6);
memcpy(pFb1 + now_pixel + 1, &gFontSmall_More[6], 6);
} else
memcpy(pFb + now_pixel + 1, &gFontSmall[index], 6);
}
now_pixel += 7;
@ -153,8 +169,6 @@ void UI_PrintStringSmall(const char *pString, uint8_t Start, uint8_t End, uint8_
}
memcpy(pFb + now_pixel + 1, &gFontChinese[0], 11);
memcpy(pFb1 + now_pixel + 1, &gFontChinese[11], 11);
now_pixel += 12;
}
}

View file

@ -4,7 +4,7 @@
#ifdef GIT_HASH
#define VER GIT_HASH
#else
#define VER "110"
#define VER "111"
#endif
#ifndef ONE_OF_ELEVEN_VER

View file

@ -1,43 +0,0 @@
#0.10.7
修复“搜索恢复模式设置失效”
修复“MDC ID菜单项无法输入数字切换菜单项”
修复"MDC解码失败问题"(应该是修复了)
#0.10.6
纠正MDC信令
#0.10.4
在解锁全部频段下允许200M,350M,500M删除对应菜单
修复“按键音开机后失效“
修复“宽窄带开机后失效“
频谱图增加AM-FIX
增加MDC1200信令(收/发、修改ID)
删除开机显示(没flash了)
#0.10.3
修复“长按菜单切换调制模式AM/FM/USB再切回FM亚音消失问题”
锁定按键改成原来的逻辑,以后这种操作逻辑相关的都不来改了,众口难调
#0.10.2
修复命名信道时频率会变化的bug
锁定按键时只允许发射/接收按键,与官方中文版逻辑一致
#0.10.1
重构代码,菜单名使用中文(是的,中文宏定义,感谢现代编译器,中文见/ui/menu.c
优化代码节省了1.4KB
修复扫描时“频差”翻译错误,纠正为“频率”
修复开机显示菜单选项错误问题
(哥们比较空,所以更新的快,其实不用天天升级,跟着大版本升级就好了)
# 0.10
* 版本为egcn变种旨在精简固件植入更多功能如MDC1200信令
* egcn更新至191结束:https://github.com/losehu/uv-k5-firmware-egcn/tree/main
# 操作更新
* 删除开启背光菜单,发射/接收时将自动开启背光
* 删除按键自动功能要锁自己长按F锁定键盘
* 麦克风条默认开启
* 删除开机电压显示,集成在信息显示中
* 删除长按M键菜单、长短、按侧键1、2按键菜单、调制模式菜单、按键音菜单、发射功率菜单、搜索列表
* **长按M切换调制模式**
* **F+M ,按键音开关切换**
* **短按侧键1是监听**
* **长按侧键1是DTMF解码开关**
* **短按侧键2是设置宽窄带**
* **长按侧键2是手电筒**
* **长按6切换发射功率**
* **长按5切换搜索列表**