Prevent Direct Write being set if user uses RTL
Ref: 975d29b30b (commitcomment-132946815)
Close #14374
This commit is contained in:
parent
c62e222985
commit
9bc790b014
|
@ -5,7 +5,7 @@ Translation note:
|
|||
2. All the comments are for explanation, they are not for translation.
|
||||
-->
|
||||
<NotepadPlus>
|
||||
<Native-Langue name="English" filename="english.xml" version="8.5.9">
|
||||
<Native-Langue name="English" filename="english.xml" version="8.6">
|
||||
<Menu>
|
||||
<Main>
|
||||
<!-- Main Menu Entries -->
|
||||
|
@ -1505,6 +1505,7 @@ NOTE: Choosing not to create the placeholders or closing them later, your manual
|
|||
Would you like to create those placeholders?
|
||||
|
||||
NOTE: Choosing not to create the placeholders or closing them later, your session WILL BE MODIFIED ON EXIT! We suggest you backup your "session.xml" now."/>
|
||||
<RTLvsDirectWrite title="Cannot run RTL" message="RTL is not compatible with DirectWrite mode. Please disable DirectWrite mode in MISC. section of Preferences dialog, restart Notepad++, and try this command again."/>
|
||||
</MessageBox>
|
||||
<ClipboardHistory>
|
||||
<PanelTitle name="Clipboard History"/>
|
||||
|
|
|
@ -5,7 +5,7 @@ Translation note:
|
|||
2. All the comments are for explanation, they are not for translation.
|
||||
-->
|
||||
<NotepadPlus>
|
||||
<Native-Langue name="English" filename="english_customizable.xml" version="8.5.9">
|
||||
<Native-Langue name="English" filename="english_customizable.xml" version="8.6">
|
||||
<Menu>
|
||||
<Main>
|
||||
<!-- Main Menu Entries -->
|
||||
|
@ -1505,6 +1505,7 @@ NOTE: Choosing not to create the placeholders or closing them later, your manual
|
|||
Would you like to create those placeholders?
|
||||
|
||||
NOTE: Choosing not to create the placeholders or closing them later, your session WILL BE MODIFIED ON EXIT! We suggest you backup your "session.xml" now."/>
|
||||
<RTLvsDirectWrite title="Cannot run RTL" message="RTL is not compatible with DirectWrite mode. Please disable DirectWrite mode in MISC. section of Preferences dialog, restart Notepad++, and try this command again."/>
|
||||
</MessageBox>
|
||||
<ClipboardHistory>
|
||||
<PanelTitle name="Clipboard History"/>
|
||||
|
|
|
@ -5,7 +5,7 @@ Translation note:
|
|||
2. All the comments are for explanation, they are not for translation.
|
||||
-->
|
||||
<NotepadPlus>
|
||||
<Native-Langue name="français" filename="french.xml" version="8.5.9">
|
||||
<Native-Langue name="français" filename="french.xml" version="8.6">
|
||||
<Menu>
|
||||
<Main>
|
||||
<!-- Main Menu Entries -->
|
||||
|
@ -1505,6 +1505,7 @@ Notez que si vous choisissez de ne pas créer d'espaces réservés ou de les fer
|
|||
Voulez-vous créer des espaces réservés pour eux ?
|
||||
|
||||
NOTE : Si vous choisissez de ne pas créer d'espaces réservés ou de les fermer plus tard, votre fichier de session sera modifié à la sortie. Nous vous suggérons de faire une sauvegarde du fichier de session "session.xml" maintenant."/>
|
||||
<RTLvsDirectWrite title="Exécution de la commande "Texte de droite à gauche" impossible" message=""Texte de droite à gauche" n'est pas compatible avec le mode "DirectWrite". Veuillez désactiver ce mode dans la section "Divers" du dialogue Préférences, redémarer Notepad++, pour exécuter la commande de nouveau."/>
|
||||
</MessageBox>
|
||||
<ClipboardHistory>
|
||||
<PanelTitle name="Historique du presse-papier"/>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<NotepadPlus>
|
||||
<Native-Langue name="台灣繁體" filename="taiwaneseMandarin.xml" version="8.5.9">
|
||||
<Native-Langue name="台灣繁體" filename="taiwaneseMandarin.xml" version="8.6">
|
||||
<Menu>
|
||||
<Main>
|
||||
<!-- Main Menu Entries -->
|
||||
|
@ -1233,7 +1233,7 @@
|
|||
<Item id="6324" name="文件切換器(Ctrl + TAB)"/>
|
||||
<Item id="6331" name="在標題列僅顯示檔案名稱(隱藏資料夾路徑)"/>
|
||||
<Item id="6334" name="自動偵測檔案編碼"/>
|
||||
<Item id="6349" name="使用 DirectWrite(可改善特殊字符的呈現,需要重新啟動 Notepad++)"/>
|
||||
<Item id="6349" name="使用「直接寫入」模式(可改善特殊字符的呈現,需要重新啟動 Notepad++)"/>
|
||||
<Item id="6337" name="資料夾工作區檔案副檔名:"/>
|
||||
<Item id="6114" name="啟動"/>
|
||||
<Item id="6117" name="開啟「最近使用的檔案」功能"/>
|
||||
|
@ -1390,6 +1390,7 @@
|
|||
你想為它們創建佔位欄嗎?
|
||||
|
||||
請注意,如果你選擇不創建佔位欄或稍後關閉它們,工作階段檔案將在 Notepad++ 關閉時被修改。我們建議你現在備份工作階段檔案 "session.xml" 。"/>
|
||||
<RTLvsDirectWrite title="無法執行「文字由右至左」指令" message="「文字由右至左」指令與「直接寫入」模式不相容。 請在偏好設定對話框的「其他」中停用「直接寫入」模式,然後重新啟動 Notepad++,重試此指令。"/>
|
||||
</MessageBox>
|
||||
<ClipboardHistory>
|
||||
<PanelTitle name="剪貼簿記錄"/>
|
||||
|
|
|
@ -3802,13 +3802,26 @@ void Notepad_plus::command(int id)
|
|||
case IDM_EDIT_LTR :
|
||||
{
|
||||
bool toRTL = id == IDM_EDIT_RTL;
|
||||
|
||||
bool isRTL = _pEditView->isTextDirectionRTL();
|
||||
|
||||
if ((toRTL && isRTL) || (!toRTL && !isRTL))
|
||||
{
|
||||
if (! ((NppParameters::getInstance()).getNppGUI())._muteSounds)
|
||||
::MessageBeep(MB_OK);
|
||||
break;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (toRTL && (NppParameters::getInstance()).getNppGUI()._writeTechnologyEngine == directWriteTechnology)
|
||||
{
|
||||
_nativeLangSpeaker.messageBox("RTLvsDirectWrite",
|
||||
_pPublicInterface->getHSelf(),
|
||||
TEXT("RTL is not compatible with Direct Write mode. Please disable DirectWrite mode in MISC. section of Preferences dialog, restart Notepad++, and try this command again."),
|
||||
TEXT("Cannot run RTL"),
|
||||
MB_OK | MB_APPLMODAL);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
_pEditView->changeTextDirection(toRTL);
|
||||
|
|
|
@ -312,10 +312,18 @@ void ScintillaEditView::init(HINSTANCE hInst, HWND hPere)
|
|||
execute(SCI_INDICSETUNDER, SCE_UNIVERSAL_FOUND_STYLE_EXT4, true);
|
||||
execute(SCI_INDICSETUNDER, SCE_UNIVERSAL_FOUND_STYLE_EXT5, true);
|
||||
|
||||
NppGUI& nppGui = (NppParameters::getInstance()).getNppGUI();
|
||||
|
||||
HMODULE hNtdllModule = ::GetModuleHandle(L"ntdll.dll");
|
||||
FARPROC isWINE = ::GetProcAddress(hNtdllModule, "wine_get_version");
|
||||
if ((NppParameters::getInstance()).getNppGUI()._writeTechnologyEngine == directWriteTechnology && !isWINE) // There is a performance issue under WINE when DirectWright is ON,
|
||||
// so we turn it off if user uses Notepad++ under WINE
|
||||
FARPROC isWINE = nullptr;
|
||||
if (hNtdllModule)
|
||||
isWINE = ::GetProcAddress(hNtdllModule, "wine_get_version");
|
||||
|
||||
if (isWINE || // There is a performance issue under WINE when DirectWright is ON, so we turn it off if user uses Notepad++ under WINE
|
||||
isTextDirectionRTL()) // RTL is not compatible with Direct Write Technology
|
||||
nppGui._writeTechnologyEngine = defaultTechnology;
|
||||
|
||||
if (nppGui._writeTechnologyEngine == directWriteTechnology)
|
||||
{
|
||||
execute(SCI_SETTECHNOLOGY, SC_TECHNOLOGY_DIRECTWRITE);
|
||||
// If useDirectWrite is turned off, leave the technology setting untouched,
|
||||
|
|
Loading…
Reference in New Issue