XhmikosR / notepad2-mod

LOOKING FOR DEVELOPERS - Notepad2-mod, a Notepad2 fork, a fast and light-weight Notepad-like text editor with syntax highlighting
https://xhmikosr.github.io/notepad2-mod/
Other
1.45k stars 270 forks source link

Font names interpretation is changed in Scintilla v3.5.3 #105

Open bluenlive opened 9 years ago

bluenlive commented 9 years ago

Till Scintilla v3.5.2, font names are interpreted as multi byte. But, in v3.5.3, it was changed to UTF-8.

Therefore, Styles.c should be changed.

void Style_SetStyles(HWND hwnd,int iStyle,LPCWSTR lpszStyle)
{
   ... bla bla ...
  WideCharToMultiByte(CP_ACP,0,tch,-1,mch,COUNTOF(mch),NULL,NULL);

that line(4034) should be change to

  WideCharToMultiByte(CP_UTF8, 0, tch, -1, mch, COUNTOF(mch), NULL, NULL);
XhmikosR commented 9 years ago

That is unrelated to Scintilla as far as I can tell.

bluenlive commented 9 years ago

No. It's definitly Scintilla related issue. You'd better read following pages.

https://sourceforge.net/p/scintilla/bugs/1684/ https://groups.google.com/forum/#!topic/scintilla-interest/ti3PE4LDMNs/discussion

XhmikosR commented 9 years ago

Well, I don't need to read anything. You can make a PR and provide proof that the current way fails and what the PR fixes.

bluenlive commented 9 years ago

Neil Hodgson wrote "This is likely due to a change in the interpretation of font names. Font names must now be in UTF-8.", not me. And, current notepad2-mod store font name as ANSI.

Upper code changes from ANSI to UTF-8 in that part.

wrong 4.2.25.940: font "맑은 Envy 고딕" is selected. But, system default font is shown. (It's Korean font)

correct fixed one: "맑은 Envy 고딕" is selected and shown.

XhmikosR commented 9 years ago

But in both of your screenshots the selected font seems the same to me.

Anyway, please make a PR. I know there were some relevant changes in that Scintilla part, but from my tests things work fine on my machines. And your screenshots look fine; remember I don't speak Korean so they look fine at least.