TextAnalysisTool / Releases

Repository for storing release artifacts (ex: binaries).
94 stars 26 forks source link

Change default font and/or allow customizing font; GenericMonospace displays some Unicode characters incorrectly #13

Closed wjhssfs closed 7 years ago

wjhssfs commented 9 years ago

This tool is so great! There seems like an issue with displaying Unicode characters. repro

DavidAnson commented 9 years ago

In Notepad, can you do File | Save As and make sure an encoding like UTF-8 or Unicode is selected and try again? TextAnalysisTool.NET knows how to open and display Unicode data if the file has an appropriate BOM.

If that does not help, the issue might be that the system's monospace font does not automatically fall back to a good font. Can you please paste those characters here or give the Unicode code points for them so we can try to reproduce locally?

wjhssfs commented 9 years ago

It is very likely an issue with the default font. Does textAnalysis support switching font? I cann't find it via the UI.

I've attached the files I'm using. Unicode.txt has BOM, unicode_utf8 is same content saved as UTF8 encoding. Below is the content in those files. 中文

On Wed, Jul 1, 2015 at 6:33 PM, David Anson notifications@github.com wrote:

In Notepad, can you do File | Save As and make sure an encoding like UTF-8 or Unicode is selected and try again? TextAnalysisTool.NET knows how to open and display Unicode data if the file has an appropriate BOM.

If that does not help, the issue might be that the system's monospace font does not automatically fall back to a good font. Can you please paste those characters here or give the Unicode code points for them so we can try to reproduce locally?

— Reply to this email directly or view it on GitHub https://github.com/TextAnalysisTool/Releases/issues/13#issuecomment-117869630 .

Regards Jinhui Wu

中文 中文

DavidAnson commented 9 years ago

The attachments don't show up, but I was able to create a file from the characters you pasted. That confirms this is a font fallback problem instead of a Unicode support problem. You can verify that by loading your file, then hitting Ctrl+N when that line is selected - it will open a "New Filter" dialog with the current text pre-populated - and you'll see the correct characters displayed.

The problem seems to be that TextAnalysisTool.NET uses .NET's FontFamily.GenericMonospace for its main display and that font does not support these characters. Unfortunately, it is not currently possible to change the default font - I'm going to repurpose this issue to add support for that in the future.

Thanks for the help and great example!

DavidAnson commented 7 years ago

Should be fixed in the 2016-12-09 release, thank you!