joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.81k stars 383 forks source link

Box-drawing characters detection doesn't work on vertical lines #2874

Open 1abcd opened 3 years ago

1abcd commented 3 years ago
0 1
language = zh_TW
output = ttf
country = 886,950

Enable "CJK: Switch between DBCS/SBCS modes" and "CJK: Auto-detect box-drawing characters". Not all box-drawing characters show correctly. DOSBox-X version is 0.83.17.

Wengier commented 3 years ago

Auto box-drawing character detection is very difficult to be perfect. I believe real CJK DOS systems (e.g. ETen Chinese DOS system) had similar problems. Never 100% perfect. In such case you may need to turn off "CJK: Switch between DBCS/SBCS modes" option manually.

Allofich commented 3 years ago

https://github.com/joncampbell123/dosbox-x/issues/2923 is also a problem related to box-drawing characters on different code pages.

Wengier commented 3 years ago

@Allofich Issue #2923 is more like a setting issue for the OS, but for this issue, I had to code the auto box-drawing character detection completely by myself, which I don't think can be perfect.

Wengier commented 3 years ago

@1abcd I have improved auto-detection for vertical box-drawing characters. Please check out the updated DOSBox-X build:

Edit: I made some more updates, so if you downloaded it earlier please download it again.

1abcd commented 3 years ago

@Wengier It does work on vertical line. Thanks.

此外發現個問題,若我在 [autoexec] 段落中已設定好了磁碟機 C 掛載 (mount c c:\dosbox-x),在 Windows Explorer 的右鍵選單以 Run with DOSBox-X,執行磁碟機 C 的某處檔案 (c:\dosbox-x\temp\xxx.exe) 會出現錯誤。

Wengier commented 3 years ago

@1abcd It looks that the said issue with already mounted drive C is the result of change in issue #2925 ("autoexec commands are executed after a given program exits". Adding a -prerun option to the shell command fixes the issue.

1abcd commented 3 years ago

@Wengier This works!

Windows Registry Editor Version 5.00

[HKEY_USERS\S-1-5-21-3346720362-1065023657-1254880869-1000\Software\Classes\SystemFileAssociations\.exe\shell\Run with DOSBox-X]
"Icon"="\"C:\\DOSBox-X\\dosbox-x.exe\",0"

[HKEY_USERS\S-1-5-21-3346720362-1065023657-1254880869-1000\Software\Classes\SystemFileAssociations\.exe\shell\Run with DOSBox-X\command]
@="\"C:\\DOSBox-X\\dosbox-x.exe\" -prerun -fastlaunch -defaultdir \"C:\\DOSBox-X \" \"%1\""

增加亂碼圖

未命名

我覺得有水平框線存在時再偵測垂直框線,這樣可能比較好。

1abcd commented 3 years ago

@Wengier 我在上方加了一個亂碼問題,可以研究看看。 我發現新版增加了中國海字集,對大五碼外字複製貼上的處理,我覺得可以參考使用已久的 Firefox 2 大五碼碼表 https://moztw.org/docs/big5/ ,雖然我覺得現在在DOS內輸入大五碼外字的需求應該很少。

Wengier commented 3 years ago

@1abcd Fixed the DBCS display issue in IMGMOUNT command.

关于中国海字集的clipboard功能,所有的SDL2版(Windows/Linux/macOS)和macOS SDL1版应该均已支持中国海专用字符集的复制粘贴,不过也要系统支持才行。Windows/Linux的SDL1版暂时不行,以后想办法修正。

关于中国海字集的使用问题,其实它在一些场合还是挺有用的,比如汉书5的中文版本就在中国海字集开启的情况下才能正确显示一些特殊符号,而倚天自带的一些文字档也是在中国海字集开启的情况下才能正确显示。以下帖两张图显示中文TTF模式下开启中国海字集功能后的效果:

(运行汉书5.03中文版本) image

(显示倚天中文系统中所带的1995CAL.TXT档) image

汉书5.03可以在这儿下载(试着比较中国海字集开启后的效果):

Updated DOSBox-X Windows binaries can be downloaded from:

1abcd commented 3 years ago

imgmount 測試OK

@Wengier 轉碼後會有奇怪的文字顯示,再者特殊符號也無法對應,不轉碼的作法(SDL1版本)看似比較好。

未命名
Wengier commented 3 years ago

@1abcd The mess in the pasted text is caused by the border characters. The Windows binaries have been updated accordingly and try again (although copying/pasting border text in DBCS code pages is still not perfect).

1abcd commented 3 years ago

@Wengier 有比較好了,也的確不完美,至少邊框外的文字看起來正確。

對1995CAL.TXT呈現的注音符號研究了一下,發現對應的是 "乐"。(以 firefox 38.8 呈現的文字對應)

未命名

加一張圖

未命名

這裡ㄩ辨識出垂直框線

Wengier commented 3 years ago

@1abcd Thanks for the testing and information. 没有绝对的完美,制表符号的自动识别就是在中文字元和制表符号之间取舍,如果识别不足会造成制表符号错误显示为汉字,如果识别过度会造成汉字错误显示为制表符号,关键不在于错误是否有可能存在而在于错误的几率。如果错误的几率较大肯定要改进,相反则基本上很难再做进一步提升了。有特殊需要时可以关闭制表符号的自动识别或者关闭中文字元的显示,否则的话这些选项也都没有必要了。