-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from Tatsu-syo/tatsu_develop
Windows 11 2023 Update title update
- Loading branch information
Showing
12 changed files
with
290 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#include <windows.h> | ||
#include "japan.h" | ||
|
||
namespace japan { | ||
|
||
/** | ||
* @brief 必要とされる文字列 | ||
*/ | ||
tstring _neededString; | ||
|
||
/** | ||
* Charsetに対するEnumFontFamiliesExのコールバック | ||
* | ||
* @param lpelfe 論理的なフォントデータ | ||
* @param lpntme 物理的なフォントデータ | ||
* @param FontType フォントの種類 | ||
* @param lParam アプリケーション定義のデータ | ||
* @return 0:列挙を中止する 1:次のフォントを列挙する。 | ||
*/ | ||
int CALLBACK EnumFontCharsetProc( | ||
ENUMLOGFONTEX *lpelfe, // 論理的なフォントデータ | ||
NEWTEXTMETRICEX *lpntme, // 物理的なフォントデータ | ||
DWORD FontType, // フォントの種類 | ||
LPARAM lParam // アプリケーション定義のデータ | ||
) | ||
{ | ||
if (_neededString == lpelfe->elfFullName) { | ||
return 0; | ||
} | ||
|
||
return 1; | ||
|
||
} | ||
|
||
/** | ||
* Charsetに対するフォントを取得する | ||
* | ||
* @return 0:フォントが存在する 1:フォントは存在しない | ||
*/ | ||
int findCharsetFont() | ||
{ | ||
LOGFONT lf; | ||
|
||
lf.lfPitchAndFamily = 0; | ||
lf.lfCharSet = DEFAULT_CHARSET; | ||
|
||
HDC hDC; | ||
hDC = GetDC(GetDesktopWindow()); | ||
|
||
int found = 1; | ||
found = ::EnumFontFamiliesEx( | ||
hDC, | ||
&lf, | ||
(FONTENUMPROC)EnumFontCharsetProc, | ||
(LPARAM)0, | ||
0 | ||
); | ||
|
||
return found; | ||
} | ||
|
||
tstring getJapaneseFontFallback(tstring &settingString) | ||
{ | ||
int result = 1; | ||
|
||
_neededString = settingString; | ||
|
||
result = findCharsetFont(); | ||
if (result == 0) { | ||
return settingString; | ||
} | ||
|
||
_neededString = _T("游ゴシック"); | ||
result = findCharsetFont(); | ||
if (result == 0) { | ||
return _neededString; | ||
} | ||
|
||
_neededString = _T("MS UI Gothic"); | ||
|
||
return _neededString; | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
noMeiryoUI (C) 2005,2012-2023 Tatsuhiko Shoji | ||
The sources for noMeiryoUI are distributed under the MIT open source license | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <string.h> | ||
#include <tchar.h> | ||
#include <tstring.h> | ||
|
||
namespace japan { | ||
|
||
extern tstring getJapaneseFontFallback(tstring &settingString); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
noMeiryoUI (C) 2005,2012-2023 Tatsuhiko Shoji | ||
The sources for noMeiryoUI are distributed under the MIT open source license | ||
*/ | ||
#include <string.h> | ||
#include <tchar.h> | ||
#include <tstring.h> | ||
|
||
namespace korea { | ||
|
||
/** | ||
* 韓国語のフォント名を置き換える(韓国語専用) | ||
* | ||
* @param dispBuf 韓国語のフォント名 | ||
*/ | ||
void getKoreanFontName(TCHAR *dispBuf) | ||
{ | ||
if (!_tcscmp(dispBuf, _T("Gulim"))) { | ||
_tcscpy(dispBuf, _T("굴림")); | ||
} | ||
|
||
if (!_tcscmp(dispBuf, _T("GulimChe"))) { | ||
_tcscpy(dispBuf, _T("굴림체")); | ||
} | ||
|
||
if (!_tcscmp(dispBuf, _T("Gungsuh"))) { | ||
_tcscpy(dispBuf, _T("궁서")); | ||
} | ||
|
||
if (!_tcscmp(dispBuf, _T("GungsuhChe"))) { | ||
_tcscpy(dispBuf, _T("궁서체")); | ||
} | ||
|
||
if (!_tcscmp(dispBuf, _T("Dotum"))) { | ||
_tcscpy(dispBuf, _T("돋움")); | ||
} | ||
|
||
if (!_tcscmp(dispBuf, _T("DotumChe"))) { | ||
_tcscpy(dispBuf, _T("돋움체")); | ||
} | ||
|
||
if (!_tcscmp(dispBuf, _T("Malgun Gothic"))) { | ||
_tcscpy(dispBuf, _T("맑은 고딕")); | ||
} | ||
|
||
if (!_tcscmp(dispBuf, _T("Batang"))) { | ||
_tcscpy(dispBuf, _T("바탕")); | ||
} | ||
|
||
if (!_tcscmp(dispBuf, _T("BatangChe"))) { | ||
_tcscpy(dispBuf, _T("바탕체")); | ||
} | ||
|
||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
noMeiryoUI (C) 2005,2012-2023 Tatsuhiko Shoji | ||
The sources for noMeiryoUI are distributed under the MIT open source license | ||
*/ | ||
namespace korea { | ||
|
||
void getKoreanFontName(TCHAR *dispBuf); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.