Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1abcd opened this issue Sep 3, 2021 · 13 comments
Open

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

1abcd opened this issue Sep 3, 2021 · 13 comments

Comments

@1abcd
Copy link
Contributor

1abcd commented Sep 3, 2021

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
Copy link
Collaborator

Wengier commented Oct 22, 2021

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
Copy link
Contributor

#2923 is also a problem related to box-drawing characters on different code pages.

@Wengier
Copy link
Collaborator

Wengier commented Oct 22, 2021

@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 Wengier added the bug label Nov 7, 2021
Wengier added a commit that referenced this issue Nov 11, 2021
@Wengier
Copy link
Collaborator

Wengier commented Nov 12, 2021

@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
Copy link
Contributor Author

1abcd commented Nov 12, 2021

@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
Copy link
Collaborator

Wengier commented Nov 12, 2021

@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
Copy link
Contributor Author

1abcd commented Nov 12, 2021

@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
Copy link
Contributor Author

1abcd commented Nov 16, 2021

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

@Wengier
Copy link
Collaborator

Wengier commented Nov 16, 2021

@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
Copy link
Contributor Author

1abcd commented Nov 16, 2021

imgmount 測試OK

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

@Wengier
Copy link
Collaborator

Wengier commented Nov 17, 2021

@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
Copy link
Contributor Author

1abcd commented Nov 17, 2021

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

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

加一張圖
未命名
這裡ㄩ辨識出垂直框線

@Wengier
Copy link
Collaborator

Wengier commented Nov 17, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants