Skip to content
This repository has been archived by the owner on Jan 31, 2022. It is now read-only.

chinese character (utf-8) width calculate bug #36

Open
guoxiangyang opened this issue Dec 7, 2013 · 8 comments
Open

chinese character (utf-8) width calculate bug #36

guoxiangyang opened this issue Dec 7, 2013 · 8 comments
Labels

Comments

@guoxiangyang
Copy link

Table contain chinese character (utf-8) massed up.

english is ok:

1.1 1.2 1.3 1.4
2.1 2.2 2.3 2.4
----- ----- ----- -----
3.1 3.2 3.3 3.4

chinese massed up:

1.1汉字 1.2中文 1.3 中文 1.4
2.1 中文2.2 2.3 2.4
--------- --------- ---------- -----
3.1 3.2 3.3中文 3.4
@guoxiangyang
Copy link
Author

gitup make the massed up table look good with html table. but in text mode it's doen't.

@vkocubinsky
Copy link
Owner

Thanks for feedback. Which font, operation system, version sublime did you use? By default on windows and mac os (did not check linux) sublime use not monospaced font for chinese. Please try
NSimSun,FangSong,SimHei. Some users said me that table editor works with these fonts. I tested table editor with CJK characters some time ago, it worked correct. I will check a bit later your example.

@guoxiangyang
Copy link
Author

thankx for response.

I've got this problem done. It's the font settings problem. everything goes fine after I change the font to a fixed width font.

I've hack the code, it's works fine.

But another problem still there. If I put the table into an markdown document and enable the markdown mode. table goes massed up.
It seem markdown change the font.

@guoxiangyang
Copy link
Author

BTW, my enviroment is MAC OSX & ST3

@guoxiangyang
Copy link
Author

original text:
| a中文 | b中文 | c | d |
| aa | bb | c中文c | dd |
| | | | |

markdown mode
image

plan text mode
image

@vkocubinsky
Copy link
Owner

Markdown change the font if you have syntax specific settings. For check this click Preferences -> Settings - More -> Syntax Specific - User.

Also I found character(it looks as space in sublime, but it is not space) from your first example which handled incorrect by sublime table editor. I know the reason and I guess I know the fix. I will fix this only for ST3, because unicodedata python module doesn't exists under windows platform on ST2.

@ZelphirKaltstahl
Copy link

Really looking forward to this issue getting solved. I know there is an Atom package doing this properly. Let me check which one I have installed, so that it might help you in implementing it ... markdown-table-formattter it is called. Maybe you can find anything useful in their code?

@vkocubinsky
Copy link
Owner

Hi, actually I don't support SublimeTableEditor package, I have not even installed Sublime Editor. But you can fork repository if you need.

Thanks!

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

No branches or pull requests

3 participants