diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index ff29a0f7..f11f68ce 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -5285,14 +5285,24 @@ void Editor::applySettings() codeFolding().indentGuidesColor = pSettings->editor().indentLineColor(); codeFolding().fillIndents = pSettings->editor().fillIndents(); - QFont f=QFont(pSettings->editor().fontName()); + QStringList fontFamilies{ + pSettings->editor().fontName(), + pSettings->editor().fallbackFontName() + }; + QFont f=QFont(); + f.setFamilies(fontFamilies); f.setPixelSize(pointToPixel(pSettings->editor().fontSize())); f.setStyleStrategy(QFont::PreferAntialias); setFont(f); - QFont f2=QFont(pSettings->editor().nonAsciiFontName()); - f2.setPixelSize(pointToPixel(pSettings->editor().fontSize())); - f2.setStyleStrategy(QFont::PreferAntialias); - setFontForNonAscii(f2); + + // QFont f=QFont(pSettings->editor().fontName()); + // f.setPixelSize(pointToPixel(pSettings->editor().fontSize())); + // f.setStyleStrategy(QFont::PreferAntialias); + // setFont(f); + // QFont f2=QFont(pSettings->editor().nonAsciiFontName()); + // f2.setPixelSize(pointToPixel(pSettings->editor().fontSize())); + // f2.setStyleStrategy(QFont::PreferAntialias); + // setFontForNonAscii(f2); setLineSpacingFactor(pSettings->editor().lineSpacing()); // Set gutter properties diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 3a40dc56..9f66b99d 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -1436,16 +1436,18 @@ void MainWindow::updateStatusbarForLineCol(const Editor* e, bool clear) if (!clear && e!=nullptr) { QString msg; if (e->selAvail()) { - msg = tr("Line: %1 Char: %2 Sel:%3 Lines: %4") - .arg(e->caretY()) - .arg(e->caretX()) - .arg(e->selText().length()) - .arg(e->document()->count()); + msg = tr("Line: %1/%2 Char: %3/%4 Sel:%5") + .arg(e->caretY()) + .arg(e->document()->count()) + .arg(e->caretX()) + .arg(e->lineText().length()) + .arg(e->selText().length()); } else { - msg = tr("Line: %1 Char: %2 Lines: %3") - .arg(e->caretY()) - .arg(e->caretX()) - .arg(e->document()->count()); + msg = tr("Line: %1/%2 Char: %3/%4") + .arg(e->caretY()) + .arg(e->document()->count()) + .arg(e->caretX()) + .arg(e->lineText().length()); } mFileInfoStatus->setText(msg); } else { diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index 4c129f7e..ba4d232c 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -667,14 +667,14 @@ void Settings::Editor::setEnableLigaturesSupport(bool newEnableLigaturesSupport) mEnableLigaturesSupport = newEnableLigaturesSupport; } -const QString &Settings::Editor::nonAsciiFontName() const +const QString &Settings::Editor::fallbackFontName() const { - return mNonAsciiFontName; + return mFallbackFontName; } -void Settings::Editor::setNonAsciiFontName(const QString &newNonAsciiFontName) +void Settings::Editor::setFallbackFontName(const QString &newFontName) { - mNonAsciiFontName = newNonAsciiFontName; + mFallbackFontName = newFontName; } int Settings::Editor::mouseSelectionScrollSpeed() const @@ -1348,7 +1348,7 @@ void Settings::Editor::doSave() //Font //font saveValue("font_name", mFontName); - saveValue("non_ascii_font_name", mNonAsciiFontName); + saveValue("fallback_font_name", mFallbackFontName); saveValue("font_size", mFontSize); saveValue("font_only_monospaced", mFontOnlyMonospaced); saveValue("line_spacing",mLineSpacing); @@ -1491,7 +1491,7 @@ void Settings::Editor::doLoad() defaultCjkFontName = CJK_MONO_FONT_K; else if (defaultLocaleName == "zh_CN") defaultCjkFontName = CJK_MONO_FONT_SC; - mNonAsciiFontName = stringValue("non_ascii_font_name",defaultCjkFontName); + mFallbackFontName = stringValue("fallback_font_name",defaultCjkFontName); mFontSize = intValue("font_size",12); mFontOnlyMonospaced = boolValue("font_only_monospaced",true); mLineSpacing = doubleValue("line_spacing",1.1); diff --git a/RedPandaIDE/settings.h b/RedPandaIDE/settings.h index ddb91f83..5ce9c481 100644 --- a/RedPandaIDE/settings.h +++ b/RedPandaIDE/settings.h @@ -355,8 +355,8 @@ public: bool enableLigaturesSupport() const; void setEnableLigaturesSupport(bool newEnableLigaturesSupport); - const QString &nonAsciiFontName() const; - void setNonAsciiFontName(const QString &newNonAsciiFontName); + const QString &fallbackFontName() const; + void setFallbackFontName(const QString &newNonAsciiFontName); int mouseSelectionScrollSpeed() const; void setMouseSelectionScrollSpeed(int newMouseSelectionScrollSpeed); diff --git a/RedPandaIDE/settingsdialog/editorfontwidget.cpp b/RedPandaIDE/settingsdialog/editorfontwidget.cpp index 5ee51d98..49437b8f 100644 --- a/RedPandaIDE/settingsdialog/editorfontwidget.cpp +++ b/RedPandaIDE/settingsdialog/editorfontwidget.cpp @@ -56,7 +56,7 @@ void EditorFontWidget::doLoad() //font ui->chkOnlyMonospacedFonts->setChecked(pSettings->editor().fontOnlyMonospaced()); ui->cbFont->setCurrentFont(QFont(pSettings->editor().fontName())); - ui->cbNonAsciiFont->setCurrentFont(QFont(pSettings->editor().nonAsciiFontName())); + ui->cbFallbackFont->setCurrentFont(QFont(pSettings->editor().fallbackFontName())); ui->spinFontSize->setValue(pSettings->editor().fontSize()); ui->spinLineSpacing->setValue(pSettings->editor().lineSpacing()); ui->chkLigature->setChecked(pSettings->editor().enableLigaturesSupport()); @@ -84,7 +84,7 @@ void EditorFontWidget::doSave() //font pSettings->editor().setFontOnlyMonospaced(ui->chkOnlyMonospacedFonts->isChecked()); pSettings->editor().setFontName(ui->cbFont->currentFont().family()); - pSettings->editor().setNonAsciiFontName(ui->cbNonAsciiFont->currentFont().family()); + pSettings->editor().setFallbackFontName(ui->cbFallbackFont->currentFont().family()); pSettings->editor().setFontSize(ui->spinFontSize->value()); pSettings->editor().setLineSpacing(ui->spinLineSpacing->value()); diff --git a/RedPandaIDE/settingsdialog/editorfontwidget.ui b/RedPandaIDE/settingsdialog/editorfontwidget.ui index 469ed77d..e1a61717 100644 --- a/RedPandaIDE/settingsdialog/editorfontwidget.ui +++ b/RedPandaIDE/settingsdialog/editorfontwidget.ui @@ -39,7 +39,7 @@ 0 - + false @@ -224,7 +224,7 @@ - Font for non-ascii Text: + Fallback Font: diff --git a/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts b/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts index d33fb003..8f1832ce 100644 --- a/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts +++ b/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts @@ -1483,7 +1483,7 @@ Font for non-ascii Text: - Fonte para texto não ASCII: + Fonte para texto não ASCII: Gutter @@ -1553,6 +1553,10 @@ Line break + + Fallback Font: + + EditorGeneralWidget @@ -5416,11 +5420,11 @@ - Line: %1 Char: %2 Sel:%3 Lines: %4 + Line: %1/%2 Char: %3/%4 Sel:%5 - Line: %1 Char: %2 Lines: %3 + Line: %1/%2 Char: %3/%4 diff --git a/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts b/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts index 40673f19..01bcabd1 100644 --- a/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts +++ b/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts @@ -1607,24 +1607,24 @@ p, li { white-space: pre-wrap; } 要剪切的内容超过了字符数限制! - + hex: %1 16进制: %1 - + dec: %1 十进制: %1 - + Print Document 打印文档 - - - + + + Ctrl+click for more info Ctrl+单击以获取更多信息 @@ -1633,27 +1633,27 @@ p, li { white-space: pre-wrap; } 未找到符号'%1'! - + astyle not found 找不到astyle程序 - + Can't find astyle in "%1". 找不到astyle程序"%1". - + Break point condition 断点条件 - + Enter the condition of the breakpoint: 输入当前断点的生效条件: - + Readonly 只读 @@ -2068,7 +2068,7 @@ p, li { white-space: pre-wrap; } Font: - 英文字体: + 字体: @@ -2081,9 +2081,8 @@ p, li { white-space: pre-wrap; } 启用合字显示支持(需要Fira Code等字体) - Font for non-ascii Text: - 非英文字体: + 非英文字体: Show special chars @@ -2099,6 +2098,11 @@ p, li { white-space: pre-wrap; } Line Spacing: 行高: + + + Fallback Font: + 备选字体: + Show whitespaces @@ -4479,11 +4483,11 @@ p, li { white-space: pre-wrap; } - - - - - + + + + + Issues 编译器 @@ -4557,7 +4561,7 @@ p, li { white-space: pre-wrap; } - + Debug Console 调试主控台 @@ -4766,9 +4770,9 @@ p, li { white-space: pre-wrap; } - - - + + + Copy 复制 @@ -4779,7 +4783,7 @@ p, li { white-space: pre-wrap; } - + Paste 粘贴 @@ -4790,8 +4794,8 @@ p, li { white-space: pre-wrap; } - - + + Select All 选择全部 @@ -4915,38 +4919,38 @@ p, li { white-space: pre-wrap; } - - + + New Problem Set 新建试题集 - + Add Problem 添加试题 - + Remove Problem 删除试题 - - + + Save Problem Set 保存试题集 - - + + Load Problem Set 载入试题集 @@ -4994,7 +4998,7 @@ p, li { white-space: pre-wrap; } - + Remove Problem Case Remove Problem Set 删除试题案例 @@ -5002,21 +5006,21 @@ p, li { white-space: pre-wrap; } - + Open Anwser Source File 打开答案源代码文件 - + Run All Cases Run Current Case 运行所有案例 - + Problem Cases Validation Options 测试案例验证选项 @@ -5076,15 +5080,15 @@ p, li { white-space: pre-wrap; } - - + + Import FPS Problem Set 导入FPS试题集 - - + + Export FPS Problem Set 导出FPS试题集 @@ -5335,7 +5339,7 @@ p, li { white-space: pre-wrap; } - + Clear all breakpoints 删除所有断点 @@ -5699,7 +5703,7 @@ p, li { white-space: pre-wrap; } 保存为模板... - + New File 新建文件 @@ -5740,7 +5744,7 @@ p, li { white-space: pre-wrap; } - + Rename Symbol 重命名符号 @@ -5761,13 +5765,13 @@ p, li { white-space: pre-wrap; } - + Export As RTF 导出为RTF - + Export As HTML 导出为HTML @@ -6036,7 +6040,7 @@ p, li { white-space: pre-wrap; } 运行参数... - + File Encoding 文件编码 @@ -6085,17 +6089,17 @@ p, li { white-space: pre-wrap; } 行: %1 列: %2 已选择 :%3 总行数: %4 总长度: %5 - + Read Only 只读 - + Insert 插入 - + Overwrite 覆写 @@ -6112,7 +6116,7 @@ p, li { white-space: pre-wrap; } 确认 - + Source file is not compiled. 源文件尚未编译。 @@ -6129,39 +6133,39 @@ p, li { white-space: pre-wrap; } 重新编译? - - - - + + + + Wrong Compiler Settings 错误的编译器设置 - - - - + + + + Compiler is set not to generate executable. 编译器被设置为不生成可执行文件。 - - + + We need the executabe to run problem case. 我们需要可执行文件来运行试题案例。 - + No compiler set 无编译器设置 - + No compiler set is configured. 没有配置编译器设置。 - + Can't start debugging. 无法启动调试器 @@ -6182,33 +6186,33 @@ p, li { white-space: pre-wrap; } 项目尚未构建。是否构建? - + Host applcation missing 宿主程序不存在 - + DLL project needs a host application to run. 动态链接库(DLL)需要一个宿主程序来运行。 - + But it's missing. 但它不存在。 - + Host application not exists 宿主程序不存在 - + Host application file '%1' doesn't exist. 宿主程序'%1'不存在。 - - + + Please correct this before start debugging 请在调试前改正设置。 @@ -6217,8 +6221,8 @@ p, li { white-space: pre-wrap; } 重新编译? - - + + Save last open info error 保存上次打开信息失败 @@ -6227,37 +6231,47 @@ p, li { white-space: pre-wrap; } 无法删除旧上次打开信息文件'%1' - + Can't save last open info file '%1' 无法保存上次打开信息文件'%1' - - + + Load last open info error 载入上次打开信息失败 - - + + Can't load last open info file '%1' 无法载入上次打开信息文件'%1' - + Open Source File 打开源代码文件 - - - + + Line: %1/%2 Char: %3/%4 Sel:%5 + 行: %1/%2 字符: %3/%4 选中:%5 + + + + Line: %1/%2 Char: %3/%4 + 行: %1/%2 字符: %3/%4 + + + + + Correct compile settings for debug 纠正调试用编译设置 - - + + The generated executable won't have debug symbol infos, and can't be debugged. 生成的可执行文件中会缺少调试符号信息,因此无法编译。 @@ -6265,82 +6279,82 @@ p, li { white-space: pre-wrap; } If you are using the Release compiler set, please use the Debug compiler set instead. 如果你正在使用Release版的编译器设置集,请在工具栏中将其改为Debug版本。 - - - - - Or you can manually change the following settings in the options dialog's compiler set page: - 您也可以手动在选项对话框的编译器设置页中修正下列选项: - - - Turned on the "Generate debug info (-g3)" option. - - 打开“生成调试信息(-g3)"选项. + Or you can manually change the following settings in the options dialog's compiler set page: + 您也可以手动在选项对话框的编译器设置页中修正下列选项: - - Turned off the "Strip executable (-s)" option. - - 关闭"剥除附加信息(-s)"选项. + - Turned on the "Generate debug info (-g3)" option. + - 打开“生成调试信息(-g3)"选项. - - Turned off the "Optimization level (-O)" option or set it to "Debug (-Og)". - - 关闭"优化级别(-O)选项,或将其设置为"调试(-Og)"级别. + - Turned off the "Strip executable (-s)" option. + - 关闭"剥除附加信息(-s)"选项. - - You should recompile after change the compiler set or it's settings. - 在更换编译器设置集或修改其设置后,需要重新编译. + - Turned off the "Optimization level (-O)" option or set it to "Debug (-Og)". + - 关闭"优化级别(-O)选项,或将其设置为"调试(-Og)"级别. + + You should recompile after change the compiler set or it's settings. + 在更换编译器设置集或修改其设置后,需要重新编译. + + + + + Do you want to mannually change the compiler set settings now? 您现在就要手动修改编译器设置集的设置吗? - - + + Batch Set Cases 批量设置案例 - + Show detail debug logs 显示详细调试器日志 - + Copy all 全部复制 - + Go to Line 跳转到行 - + Line - + Template Exists 模板已存在 - + Template %1 already exists. Do you want to overwrite? 模板%1已存在。是否覆盖? @@ -6348,9 +6362,9 @@ p, li { white-space: pre-wrap; } - - - + + + Clear 清除 @@ -6366,7 +6380,7 @@ p, li { white-space: pre-wrap; } - + Problem Set %1 试题集%1 @@ -6395,66 +6409,56 @@ p, li { white-space: pre-wrap; } 项目已经被修改过,是否需要重新构建? - + Auto Save Error 自动保存出错 - + Auto save "%1" to "%2" failed:%3 自动保存"%1"到"%2"失败:%3 - + Properties... 试题属性... - + Set Problem Set Name 设置试题集名称 - + Problem Set Name: 试题集名称: - + Remove 删除 - - Line: %1 Char: %2 Sel:%3 Lines: %4 - - - - - Line: %1 Char: %2 Lines: %3 - - - - + Remove All Bookmarks 删除全部书签 - + Modify Description 修改描述 - - - + + + Bookmark Description 书签描述 - - - + + + Description: 描述: @@ -6463,32 +6467,32 @@ p, li { white-space: pre-wrap; } 在调试主控台中显示调试器输出 - + Remove this search 清除这次搜索 - + Clear all searches 删除所有搜索 - + Breakpoint condition... 断点条件... - + Break point condition 断点条件 - + Enter the condition of the breakpoint: 输入当前断点的生效条件: - + Remove All Breakpoints Remove all breakpoints 删除所有断点 @@ -6498,34 +6502,34 @@ p, li { white-space: pre-wrap; } 行: %1 列: %2 选中:%3 总行数: %4 - + Remove Breakpoint 删除当前断点 - + Rename File 重命名文件 - - + + Add Folder 添加文件夹 - - + + New folder 新文件夹 - + Folder name: 文件夹: - + Rename Folder 重命名 @@ -6538,17 +6542,17 @@ p, li { white-space: pre-wrap; } 要现在去修改设置吗? - + Rename Problem Set 修改试题集名称 - + Can't open last open information file '%1' for write! 无法写入配置文件'%1'。 - + Rename Problem 修改试题名称 @@ -6577,12 +6581,12 @@ p, li { white-space: pre-wrap; } 是否现在去改正? - + Missing Project Files 项目文件缺失 - + The following files is missing, can't build the project: 下列项目文件缺失,无法构建项目: @@ -6599,202 +6603,202 @@ p, li { white-space: pre-wrap; } 请取消该设置,重新编译然后重新启动调试。 - + Goto Url 跳转到试题网址 - + Add Problem Case 添加试题案例 - + Run Current Case 运行当前案例 - + Remove Folder 删除文件夹 - + Switch to normal view 切换为普通视图 - + Switch to custom view 切换为自定义视图 - + Sort By Type 按类型排序 - + Sort alphabetically 按名称排序 - + Show inherited members 显示继承的成员 - + Goto declaration 跳转到声明处 - + Goto definition 跳转到定义处 - + In current file 仅当前文件 - + In current project 整个项目 - - + + New Folder 新建文件夹 - + Rename 重命名 - - - - - + + + + + Delete 删除 - + Open in Editor 在编辑器中打开 - + Open in External Program 使用外部程序打开 - + Open in Terminal 在终端中打开 - + Open in Windows Explorer 在文件资源管理器中打开 - + Character sets 字符集 - + Convert to %1 转换为%1编码 - + Newline 换行符 - + %1 files autosaved 已自动保存%1个文件 - + Set answer to... 设置答案源代码... - + select other file... 选择其他文件... - + Select Answer Source File 选择答案源代码文件 - + Watchpoint hitted 变量断点被触发 - + Value of "%1" has changed: "%1"的值发生了变化: - + New value: %1 新值: %1 - + Project folder removed. 项目文件夹被删除 - + Folder for project '%1' was removed. 项目"%1"的文件夹已被外部程序删除. - + It will be closed. 项目将被关闭. - + Save settings failed! 保存设置失败 - + Folder Not Empty 文件夹非空 - + The project folder is not empty, existing files may be overwritten. 项目文件夹不是空的,已有的文件可能会被覆盖。 - + Do you want to proceed? 您确定要继续吗? - + Watchpoint variable name 被监控的变量 - + Stop execution when the following variable is modified (it must be visible from the currect scope): 当下面的变量被修改时暂停执行(该变量必须可以从当前程序处访问): @@ -6803,17 +6807,17 @@ p, li { white-space: pre-wrap; } 中止 - + FPS Problem Set Files (*.fps;*.xml) FPS试题集文件(*.fps;*.xml) - + FPS Problem Set Files (*.fps) FPS试题集文件(*.fps) - + Export Error 导出时出错 @@ -6823,7 +6827,7 @@ p, li { white-space: pre-wrap; } C/C++源代码文件 (*.c *.cpp *.cc *.cxx) - + New Folder %1 新建文件夹%1 @@ -6836,13 +6840,13 @@ p, li { white-space: pre-wrap; } 无标题%1 - - + + Do you really want to delete %1? 你真的要删除%1吗? - + Do you really want to delete %1 files? 你真的要删除%1个文件吗? @@ -6855,7 +6859,7 @@ p, li { white-space: pre-wrap; } 变量"%1"有改动: - + Old value: %1 旧值: %1 @@ -6864,63 +6868,63 @@ p, li { white-space: pre-wrap; } 新值: %1 - + Save project 保存项目 - + The project '%1' has modifications. 项目'%1'有改动。 - - + + Do you want to save it? 需要保存吗? - - + + File Changed 文件已发生变化 - - - + + + New Project File? 新建项目文件? - - - + + + Do you want to add the new file to the project? 您是否要将新建的文件加入项目? - - - - - + + + + + Save Error 保存失败 - + Change Project Compiler Set 改变项目编译器配置集 - + Change the project's compiler set will lose all custom compiler set options. 改变项目的编译器配置集会导致所有的自定义编译器选项被重置。 - - + + Do you really want to do that? 你真的想要那么做吗? @@ -6929,12 +6933,12 @@ p, li { white-space: pre-wrap; } 批量设置案例 - + Choose input files 选择输入数据文件 - + Input data files (*.in) 输入数据文件 (*.in) @@ -6943,78 +6947,78 @@ p, li { white-space: pre-wrap; } 无标题%1 - + Modify Watch 修改监视表达式 - + Watch Expression 监视表达式 - + Do you really want to clear all breakpoints in this file? 您真的要清除该文件的所有断点吗? - + New project 新建项目 - + Close %1 and start new project? 关闭'%1'以打开新项目? - + Folder not exist 文件夹不存在 - + Folder '%1' doesn't exist. Create it now? 文件夹'%1'不存在。是否创建? - + Can't create folder 无法创建文件夹 - + Failed to create folder '%1'. 创建文件夹'%1'失败。 - + Save new project as - + Folder %1 is not empty. 文件夹%1不是空的。 - + Do you really want to delete it? 你真的要删除它吗? - + Change working folder 改变工作文件夹 - + File '%1' is not in the current working folder. File '%1' is not in the current working folder 文件'%1'不在当前工作文件夹中。 - + Do you want to change working folder to '%1'? 是否将工作文件夹改设为'%1'? @@ -7023,28 +7027,28 @@ p, li { white-space: pre-wrap; } 正在删除试题... - + Can't Commit 无法提交 - + Git needs user info to commit. Git需要用信息进行提交。 - + Choose Input Data File 选择输入数据文件 - - + + All files (*.*) 所有文件 (*.*) - + Choose Expected Output Data File Choose Expected Input Data File 选择期望输出文件 @@ -7056,59 +7060,59 @@ p, li { white-space: pre-wrap; } - + Choose Working Folder 选择工作文件夹 - - + + Header Exists 头文件已存在 - - + + Header file "%1" already exists! 头文件"%1"已存在! - + Source Exists 源文件已存在! - + Source file "%1" already exists! 源文件"%1"已存在! - + Can't commit! 无法提交! - + The following files are in conflicting: 下列文件处于冲突状态,请解决后重新添加和提交: - + Commit Message 提交信息 - + Commit Message: 提交信息: - + Commit Failed 提交失败 - + Commit message shouldn't be empty! 提交信息不能为空! @@ -7117,22 +7121,22 @@ p, li { white-space: pre-wrap; } 小熊猫Dev-C++项目文件 (*.dev) - + New project fail 新建项目失败 - + Can't assign project template 无法使用模板创建项目 - + Remove file 删除文件 - + Remove the file from disk? 同时从硬盘上删除文件? @@ -7141,27 +7145,27 @@ p, li { white-space: pre-wrap; } 无标题 - + New Project File Name 新的项目文件名 - + File Name: 文件名: - + File Already Exists! 文件已存在! - + File '%1' already exists! 文件'%1'已经存在! - + Add to project 添加到项目 @@ -7178,12 +7182,12 @@ p, li { white-space: pre-wrap; } 请在工具栏中选择Debug编译器配置集,或者在“编译器配置集”设置的“编译/链接选项”页中<b>启用</b>“生成调试信息(-g3)”、<b>禁用</b>“剥除附件信息(-3)”。 - + C/C++ Source Files (*.c *.cpp *.cc *.cxx) C/C++源代码文件 (*.c *.cpp *.cc *.cxx) - + This operation will remove all cases for the current problem. 本操作会删除此试题的所有案例。 @@ -7192,7 +7196,7 @@ p, li { white-space: pre-wrap; } 调试失败 - + The executable doesn't have symbol table, and can't be debugged. 可执行文件中没有符号表信息,无法调试。 @@ -7217,88 +7221,88 @@ p, li { white-space: pre-wrap; } 您也可以删除所有断点,打开“CPU信息窗口”,然后调试汇编代码。 - + Failed to generate the executable. 未能生成可执行文件。 - + Please check detail info in "Tools Output" panel. 请查看“工具输出”面板中的详细信息。 - + Red Panda C++ project file (*.dev) 小熊猫C++项目文件(*.dev) - + Rename Error 重命名出错 - + Symbol '%1' is defined in system header. 符号'%1'在系统头文件中定义,无法修改。 - + New Name 新名称 - - - - + + + + Replace Error 替换出错 - + Can't open file '%1' for replace! 无法打开文件'%1'进行替换! - + Contents has changed since last search! 内容和上次查找时不一致。 - + Rich Text Format Files (*.rtf) RTF格式文件 (*.rtf) - + HTML Files (*.html) HTML文件 (*.html) - + The current problem set is not empty. 当前的试题集不是空的。 - + Problem %1 试题%1 - - + + Problem Set Files (*.pbs) 试题集文件 (*.pbs) - - + + Load Error 载入失败 - - + + Problem Case %1 试题案例%1 @@ -7309,14 +7313,14 @@ p, li { white-space: pre-wrap; } - - - - - - - - + + + + + + + + Error 错误 @@ -7342,8 +7346,8 @@ p, li { white-space: pre-wrap; } 编译生成的可执行文件中没有符号表,无法被调试。 - - + + Version Control 版本控制 @@ -7352,46 +7356,46 @@ p, li { white-space: pre-wrap; } 请在工具栏中选用Debug编译器配置集,或者在选项对话框的编辑器配置集页中勾选“生成调试信息(-g3)"选项。 - + File '%1' was changed. 磁盘文件'%1'已被修改。 - + Reload its content from disk? 是否重新读取它的内容? - + File '%1' was removed. 磁盘文件'%1'已被删除。 - + Keep it open? 是否保持它在小熊猫C++中打开的编辑窗口? - + Open 打开 - - + + Compile Failed 编译失败 - + Run Failed 运行失败 - - - - + + + + Confirm Convertion 确认转换 @@ -7415,43 +7419,43 @@ p, li { white-space: pre-wrap; } 行: %1 列: %2 (%3个字符) 总行数: %4 - - - + + + If you are using the Release compiler set, please use choose the Debug version from toolbar. 如果你正在使用Release版的编译器设置集,请在工具栏中将其改为Debug版本。 - - - - + + + + The editing file will be saved using %1 encoding. <br />This operation can't be reverted. <br />Are you sure to continue? 当前编辑器中的文件将会使用%1编码保存。<br />这项操作无法被撤回。<br />你确定要继续吗? - + New Watch Expression 新监视表达式 - + Enter Watch Expression (it is recommended to use 'this->' for class members): 输入监视表达式 - + Parsing file %1 of %2: "%3" (%1/%2)正在解析文件"%3" - - + + Done parsing %1 files in %2 seconds 完成%1个文件的解析,用时%2秒 - + (%1 files per second) (每秒%1个文件) @@ -8857,20 +8861,20 @@ p, li { white-space: pre-wrap; } <b>The name "%1" cannot be used.</b><p>Try using another name, with fewer characters or no punctuation marks. - <b>文件名 "%1" 无法被使用!</b><p>可能是重名、过长、为空或者是使用了不能出现在文件名里的符号。 + <b>文件名 "%1" 无法被使用!</b><p>可能是重名、过长、为空或者是使用了不能出现在文件名里的符号。 QObject - + Save 保存 - + Save changes to %1? 将修改保存到"%1"? @@ -9050,7 +9054,7 @@ p, li { white-space: pre-wrap; } 生成调试信息(-g3) - + Would you like Red Panda C++ to search for compilers in PATH? 您同意小熊猫C++在PATH路径中寻找gcc编译器吗? @@ -9261,7 +9265,7 @@ p, li { white-space: pre-wrap; } 只生成汇编代码(-S) - + Confirm 确认 @@ -9282,13 +9286,13 @@ p, li { white-space: pre-wrap; } 如果仍然保留这些设置,可能会导致编译错误。<br /><br />请选择“是”,除非您清楚的知道选择“否”的后果, - - + + Compiler set not configuared. 未配置编译器设置。 - + Would you like Red Panda C++ to search for compilers in the following locations: <BR />'%1'<BR />'%2'? 您需要小熊猫C++在下列位置搜索编译器吗:<br />%1<br />%2 @@ -9657,7 +9661,7 @@ p, li { white-space: pre-wrap; } - + Can't open file '%1' for read. @@ -9712,7 +9716,7 @@ p, li { white-space: pre-wrap; } 无法检测适用于 “%1” 的终端参数模式。 - + Error executing platform compiler hint add-on 执行平台编译器提示附加组件错误 @@ -10676,12 +10680,12 @@ p, li { white-space: pre-wrap; } Settings - + Error 错误 - + Can't find terminal program! 找不到合适的终端程序! @@ -10878,18 +10882,18 @@ p, li { white-space: pre-wrap; } 性能 - - - - + + + + Compiler Set 编译器配置集 - - + + Compiler @@ -10901,7 +10905,7 @@ p, li { white-space: pre-wrap; } 自动链接 - + @@ -10977,15 +10981,15 @@ p, li { white-space: pre-wrap; } 杂项 - - + + Program Runner 程序运行 - + Problem Set 试题集 @@ -11044,8 +11048,8 @@ p, li { white-space: pre-wrap; } 项目选项 - - + + diff --git a/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts b/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts index b8a8b616..19af9fbd 100644 --- a/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts +++ b/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts @@ -1318,10 +1318,6 @@ Size: - - Font for non-ascii Text: - - Gutter @@ -1390,6 +1386,10 @@ Line break + + Fallback Font: + + EditorGeneralWidget @@ -5129,11 +5129,11 @@ - Line: %1 Char: %2 Sel:%3 Lines: %4 + Line: %1/%2 Char: %3/%4 Sel:%5 - Line: %1 Char: %2 Lines: %3 + Line: %1/%2 Char: %3/%4 diff --git a/RedPandaIDE/widgets/cpudialog.cpp b/RedPandaIDE/widgets/cpudialog.cpp index 8c9636b8..740886ab 100644 --- a/RedPandaIDE/widgets/cpudialog.cpp +++ b/RedPandaIDE/widgets/cpudialog.cpp @@ -142,14 +142,15 @@ void CPUDialog::setDisassembly(const QString& file, const QString& funcName,cons void CPUDialog::resetEditorFont(float dpi) { - QFont f=QFont(pSettings->editor().fontName()); + + QFont f=QFont(); + f.setFamilies( + QStringList{ + pSettings->editor().fontName(), + pSettings->editor().fallbackFontName()}); f.setPixelSize(pointToPixel(pSettings->editor().fontSize(),dpi)); f.setStyleStrategy(QFont::PreferAntialias); ui->txtCode->setFont(f); - QFont f2=QFont(pSettings->editor().nonAsciiFontName()); - f2.setPixelSize(pointToPixel(pSettings->editor().fontSize(),dpi)); - f2.setStyleStrategy(QFont::PreferAntialias); - ui->txtCode->setFontForNonAscii(f2); } void CPUDialog::sendSyntaxCommand() diff --git a/libs/qsynedit/qsynedit/document.cpp b/libs/qsynedit/qsynedit/document.cpp index cab25361..c96adf2d 100644 --- a/libs/qsynedit/qsynedit/document.cpp +++ b/libs/qsynedit/qsynedit/document.cpp @@ -33,7 +33,6 @@ namespace QSynedit { Document::Document(const QFont& font, const QFont& nonAsciiFont, QObject *parent): QObject(parent), mFontMetrics(font), - mNonAsciiFontMetrics(nonAsciiFont), mTabSize(4), #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) mMutex() @@ -591,12 +590,11 @@ const QFontMetrics &Document::fontMetrics() const return mFontMetrics; } -void Document::setFontMetrics(const QFont &newFont, const QFont& newNonAsciiFont) +void Document::setFont(const QFont &newFont) { mFontMetrics = QFontMetrics(newFont); mCharWidth = mFontMetrics.horizontalAdvance("M"); mSpaceWidth = mFontMetrics.horizontalAdvance(" "); - mNonAsciiFontMetrics = QFontMetrics(newNonAsciiFont); invalidateAllLineWidth(); } @@ -896,11 +894,11 @@ int Document::stringWidth(const QString &str, int left) const return right - left; } -int Document::stringWidth(const QString &str, int left, const QFontMetrics &asciFontMetrics, const QFontMetrics &nonAsciiFontMetrics) +int Document::stringWidth(const QString &str, int left, const QFontMetrics &fontMetrics) { QList glyphStartCharList = calcGlyphStartCharList(str); int right; - calcGlyphPositionList(str, glyphStartCharList, asciFontMetrics, nonAsciiFontMetrics, left, right); + calcGlyphPositionList(str, glyphStartCharList, fontMetrics, left, right); return right - left; } @@ -938,7 +936,7 @@ int Document::glyphWidth(int line, int glyphIdx) int Document::glyphWidth(const QString &glyph, int left) const { - return glyphWidth(glyph,left,mFontMetrics, mNonAsciiFontMetrics); + return glyphWidth(glyph,left,mFontMetrics); } int Document::charToGlyphIndex(int line, int charIdx) @@ -971,7 +969,7 @@ QList Document::calcLineWidth(const QString &lineText, const QList &gl return calcGlyphPositionList(lineText,glyphStartCharList,0,width); } -QList Document::calcGlyphPositionList(const QString &lineText, const QList &glyphStartCharList, const QFontMetrics &fontMetrics, const QFontMetrics &nonAsciiFontMetrics, int left, int &right) const +QList Document::calcGlyphPositionList(const QString &lineText, const QList &glyphStartCharList, const QFontMetrics &fontMetrics, int left, int &right) const { right = std::max(0,left); int start,end; @@ -984,7 +982,7 @@ QList Document::calcGlyphPositionList(const QString &lineText, const QList< end = lineText.length(); } QString glyph = lineText.mid(start,end-start); - int gWidth = glyphWidth(glyph, right, fontMetrics, nonAsciiFontMetrics); + int gWidth = glyphWidth(glyph, right, fontMetrics); glyphPostionList.append(right); right += gWidth; } @@ -1157,7 +1155,6 @@ QList Document::calcGlyphPositionList(const QString &lineText, const QList< { return calcGlyphPositionList(lineText, glyphStartCharList, mFontMetrics, - mNonAsciiFontMetrics, left,right); } @@ -1720,7 +1717,7 @@ int searchForSegmentIdx(const QList &segList, int minVal, int maxVal, int v int Document::updateGlyphStartPositionList( const QString &lineText, const QList &glyphStartCharList, int startChar, int endChar, - const QFontMetrics &fontMetrics, const QFontMetrics &nonAsciiFontMetrics, + const QFontMetrics &fontMetrics, QList &glyphStartPositionList, int left, int &right, int &startGlyph, int &endGlyph) const { right = std::max(0,left); @@ -1735,7 +1732,7 @@ int Document::updateGlyphStartPositionList( end = lineText.length(); } QString glyph = lineText.mid(start,end-start); - int gWidth = glyphWidth(glyph, right, fontMetrics, nonAsciiFontMetrics); + int gWidth = glyphWidth(glyph, right, fontMetrics); glyphStartPositionList[i] = right; right += gWidth; } @@ -1744,19 +1741,16 @@ int Document::updateGlyphStartPositionList( return right-left; } -int Document::glyphWidth(const QString &glyph, int left, const QFontMetrics &fontMetrics, const QFontMetrics &nonAsciiFontMetrics) const +int Document::glyphWidth(const QString &glyph, int left, const QFontMetrics &fontMetrics) const { int glyphWidth; - if (glyph.length()==1 && glyph[0].unicode()<128) { - QChar ch = glyph[0]; - if (ch == '\t') { - glyphWidth = tabWidth() - left % tabWidth(); - } else { - glyphWidth = fontMetrics.horizontalAdvance(ch); - //qDebug()< &glyphStartCharList, int startChar, int endChar, - const QFontMetrics &fontMetrics, const QFontMetrics &nonAsciiFontMetrics, + const QFontMetrics &fontMetrics, QList &glyphStartPositionList, int left, int &right, int &startGlyph, int &endGlyph) const; @@ -546,7 +546,7 @@ public: void setTabSize(int newTabSize); const QFontMetrics &fontMetrics() const; - void setFontMetrics(const QFont &newFont, const QFont& newNonAsciiFont); + void setFont(const QFont &newFont); public slots: void invalidateAllLineWidth(); @@ -569,14 +569,13 @@ private: void setLineWidth(int line, const QString& lineText, int newWidth, const QList glyphStartPositionList); int glyphWidth(const QString& glyph, int left, - const QFontMetrics &fontMetrics, const QFontMetrics &nonAsciiFontMetrics) const; + const QFontMetrics &fontMetrics) const; int xposToGlyphIndex(int strWidth, QList glyphPositionList, int xpos) const; int charToGlyphIndex(const QString& str, QList glyphStartCharList, int charPos) const; QList calcLineWidth(const QString& lineText, const QList &glyphStartCharList, int &width); QList calcGlyphPositionList(const QString& lineText, const QList &glyphStartCharList, const QFontMetrics &fontMetrics, - const QFontMetrics &nonAsciiFontMetrics, int left, int &right) const; QList calcGlyphPositionList(const QString& lineText, const QList &glyphStartCharList, int left, int &right) const; QList calcGlyphPositionList(const QString& lineText, int &width) const; @@ -596,7 +595,6 @@ private: //SynEdit* mEdit; QFontMetrics mFontMetrics; - QFontMetrics mNonAsciiFontMetrics; int mTabSize; int mCharWidth; int mSpaceWidth; diff --git a/libs/qsynedit/qsynedit/painter.cpp b/libs/qsynedit/qsynedit/painter.cpp index 7e1bba2d..1317db8f 100644 --- a/libs/qsynedit/qsynedit/painter.cpp +++ b/libs/qsynedit/qsynedit/painter.cpp @@ -360,12 +360,11 @@ void QSynEditPainter::paintToken( int startGlyph, int endGlyph, int tokenWidth, int tokenLeft, - int first, int last, bool /*isSelection*/, const QFont& font, - const QFont& fontForNonAscii, bool showGlyphs) + int first, int last, + const QFont& font, bool showGlyphs) { bool startPaint; int nX; - bool lastGlyphAscii = false; bool fontInited = false; int tokenRight = tokenWidth+tokenLeft; @@ -401,17 +400,10 @@ void QSynEditPainter::paintToken( bool drawed = false; if (mEdit->mOptions.testFlag(eoLigatureSupport)) { bool tryLigature = false; - bool isAscii = false; if (glyph.length()==0) { } else if (glyph.length()==1 && glyph.front().unicode()<=32){ - } else if (glyph.length()==1 - && glyph.front().unicode()>32 - && glyph.front().unicode()<128) { - tryLigature = true; - isAscii = true; } else { tryLigature = true; - isAscii = false; } if (tryLigature) { QString textToPaint = glyph; @@ -421,32 +413,19 @@ void QSynEditPainter::paintToken( QString glyph2 = lineText.mid(glyphStart,glyphLen); // if (!OperatorGlyphs.contains(glyph)) // break; - if (isAscii) { - if ( glyph2.length()!=1 - || glyph2.front().unicode()<=32 - || glyph2.front().unicode()>=128) - break; - } else { - if ( glyph2.length()<1 - || - (glyph2.length()==1 - && glyph2.front().unicode()>32 - && glyph2.front().unicode()<128)) - break; - } + if ( glyph2.length()<1 + || + (glyph2.length()==1 + && glyph2.front().unicode()<32)) + break; i+=1; glyphWidth += calcSegmentInterval(glyphStartPositionList, tokenRight, i); textToPaint+=glyph2; if (tokenWidth + glyphWidth > last ) break; } - if (!fontInited || lastGlyphAscii!=isAscii) { - if (isAscii) { - mPainter->setFont(font); - } else { - mPainter->setFont(fontForNonAscii); - } - lastGlyphAscii = isAscii; + if (!fontInited) { + mPainter->setFont(font); fontInited = true; } mPainter->drawText(nX,rcToken.bottom()-mPainter->fontMetrics().descent() , textToPaint); @@ -473,19 +452,17 @@ void QSynEditPainter::paintToken( ch=glyph; } if (ch!=" " && ch!="\t") { - if (!fontInited || !lastGlyphAscii) { + if (!fontInited) { mPainter->setFont(font); fontInited = true; - lastGlyphAscii = true; } mPainter->drawText(nX+padding,rcToken.bottom()-mPainter->fontMetrics().descent() , ch); } //qDebug()<<"Drawing"<setFont(fontForNonAscii); + if (!fontInited) { + mPainter->setFont(font); fontInited = true; - lastGlyphAscii = false; } mPainter->drawText(nX,rcToken.bottom()-mPainter->fontMetrics().descent() , glyph); } @@ -606,7 +583,8 @@ void QSynEditPainter::paintHighlightToken(const QString& lineText, glyphStartPositionsList, mTokenAccu.startGlyph, mTokenAccu.endGlyph, - mTokenAccu.width,mTokenAccu.left,nC1,mLineSelStart,false,mTokenAccu.font,mTokenAccu.nonAsciiFont, mTokenAccu.showSpecialGlyphs); + mTokenAccu.width,mTokenAccu.left,nC1,mLineSelStart, + mTokenAccu.font, mTokenAccu.showSpecialGlyphs); } // selected part of the token setDrawingColors(true); @@ -619,7 +597,8 @@ void QSynEditPainter::paintHighlightToken(const QString& lineText, glyphStartPositionsList, mTokenAccu.startGlyph, mTokenAccu.endGlyph, - mTokenAccu.width, mTokenAccu.left, nC1Sel, nC2Sel,true,mTokenAccu.font,mTokenAccu.nonAsciiFont, mTokenAccu.showSpecialGlyphs); + mTokenAccu.width, mTokenAccu.left, nC1Sel, nC2Sel, + mTokenAccu.font, mTokenAccu.showSpecialGlyphs); // second unselected part of the token if (bU2) { setDrawingColors(false); @@ -630,7 +609,8 @@ void QSynEditPainter::paintHighlightToken(const QString& lineText, glyphStartPositionsList, mTokenAccu.startGlyph, mTokenAccu.endGlyph, - mTokenAccu.width, mTokenAccu.left, mLineSelEnd, nC2,false,mTokenAccu.font,mTokenAccu.nonAsciiFont, mTokenAccu.showSpecialGlyphs); + mTokenAccu.width, mTokenAccu.left, mLineSelEnd, nC2, + mTokenAccu.font, mTokenAccu.showSpecialGlyphs); } } else { setDrawingColors(bSel); @@ -641,7 +621,8 @@ void QSynEditPainter::paintHighlightToken(const QString& lineText, glyphStartPositionsList, mTokenAccu.startGlyph, mTokenAccu.endGlyph, - mTokenAccu.width, mTokenAccu.left, nC1, nC2,bSel,mTokenAccu.font,mTokenAccu.nonAsciiFont, mTokenAccu.showSpecialGlyphs); + mTokenAccu.width, mTokenAccu.left, nC1, nC2, + mTokenAccu.font, mTokenAccu.showSpecialGlyphs); } } @@ -751,11 +732,6 @@ void QSynEditPainter::addHighlightToken( mTokenAccu.font.setItalic(style & FontStyle::fsItalic); mTokenAccu.font.setStrikeOut(style & FontStyle::fsStrikeOut); mTokenAccu.font.setUnderline(style & FontStyle::fsUnderline); - mTokenAccu.nonAsciiFont = mEdit->fontForNonAscii(); - mTokenAccu.nonAsciiFont.setBold(style & FontStyle::fsBold); - mTokenAccu.nonAsciiFont.setItalic(style & FontStyle::fsItalic); - mTokenAccu.nonAsciiFont.setStrikeOut(style & FontStyle::fsStrikeOut); - mTokenAccu.nonAsciiFont.setUnderline(style & FontStyle::fsUnderline); } //calculate width of the token ( and update it's glyph start positions ) int tokenRight; @@ -766,7 +742,6 @@ void QSynEditPainter::addHighlightToken( tokenStartChar, tokenEndChar, QFontMetrics(mTokenAccu.font), - QFontMetrics(mTokenAccu.nonAsciiFont), glyphStartPositionList, tokenLeft, tokenRight, @@ -1042,7 +1017,8 @@ void QSynEditPainter::paintLines() glyphStartPositionsList, 0, glyphStartCharList.length(), - tokenWidth, 0, mLineSelStart, mLineSelEnd,false,mEdit->font(),mEdit->fontForNonAscii(),false); + tokenWidth, 0, mLineSelStart, mLineSelEnd, + mEdit->font(),false); setDrawingColors(false); rcToken.setLeft(std::max(rcLine.left(), fixXValue(mLeft))); rcToken.setRight(std::min(rcLine.right(), fixXValue(mLineSelStart))); @@ -1052,7 +1028,8 @@ void QSynEditPainter::paintLines() glyphStartPositionsList, 0, glyphStartCharList.length(), - tokenWidth, 0, mLeft, mLineSelStart,false,mEdit->font(),mEdit->fontForNonAscii(),false); + tokenWidth, 0, mLeft, mLineSelStart, + mEdit->font(), false); rcToken.setLeft(std::max(rcLine.left(), fixXValue(mLineSelEnd))); rcToken.setRight(std::min(rcLine.right(), fixXValue(mRight))); paintToken( @@ -1061,7 +1038,8 @@ void QSynEditPainter::paintLines() glyphStartPositionsList, 0, glyphStartCharList.length(), - tokenWidth, 0, mLineSelEnd, mRight,true, mEdit->font(), mEdit->fontForNonAscii(),false); + tokenWidth, 0, mLineSelEnd, mRight, + mEdit->font(), false); } else { setDrawingColors(mIsLineSelected); paintToken( @@ -1070,7 +1048,8 @@ void QSynEditPainter::paintLines() glyphStartPositionsList, 0, glyphStartCharList.length(), - tokenWidth, 0, mLeft, mRight, mIsLineSelected,mEdit->font(),mEdit->fontForNonAscii(),false); + tokenWidth, 0, mLeft, mRight, + mEdit->font(),false); } //Paint editingAreaBorders if (mIsCurrentLine && mEdit->mInputPreeditString.length()>0) { diff --git a/libs/qsynedit/qsynedit/painter.h b/libs/qsynedit/qsynedit/painter.h index e7ceeb7c..ddf78319 100644 --- a/libs/qsynedit/qsynedit/painter.h +++ b/libs/qsynedit/qsynedit/painter.h @@ -38,7 +38,6 @@ class QSynEditPainter QColor background; FontStyles style; QFont font; - QFont nonAsciiFont; bool showSpecialGlyphs; }; @@ -65,7 +64,7 @@ private: int startGlyph, int endGlyph, int tokenWidth, int tokenLeft, - int first, int last, bool isSelection, const QFont& font, + int first, int last, const QFont& fontForNonAscii, bool showGlyphs); void paintEditAreas(const EditingAreaList& areaList); void paintHighlightToken(const QString& lineText, diff --git a/libs/qsynedit/qsynedit/qsynedit.cpp b/libs/qsynedit/qsynedit/qsynedit.cpp index 15192e7a..bd57211d 100644 --- a/libs/qsynedit/qsynedit/qsynedit.cpp +++ b/libs/qsynedit/qsynedit/qsynedit.cpp @@ -160,7 +160,6 @@ QSynEdit::QSynEdit(QWidget *parent) : QAbstractScrollArea(parent), setAcceptDrops(true); setFont(mFontDummy); - setFontForNonAscii(mFontDummy); } int QSynEdit::displayLineCount() const @@ -3871,19 +3870,6 @@ void QSynEdit::setMouseSelectionScrollSpeed(int newMouseSelectionScrollSpeed) mMouseSelectionScrollSpeed = newMouseSelectionScrollSpeed; } -const QFont &QSynEdit::fontForNonAscii() const -{ - return mFontForNonAscii; -} - -void QSynEdit::setFontForNonAscii(const QFont &newFontForNonAscii) -{ - mFontForNonAscii = newFontForNonAscii; - mFontForNonAscii.setStyleStrategy(QFont::PreferAntialias); - if (mDocument) - mDocument->setFontMetrics(font(),mFontForNonAscii); -} - const QColor &QSynEdit::backgroundColor() const { return mBackgroundColor; @@ -6148,7 +6134,7 @@ bool QSynEdit::event(QEvent *event) case QEvent::FontChange: synFontChanged(); if (mDocument) - mDocument->setFontMetrics(font(),mFontForNonAscii); + mDocument->setFont(font()); break; case QEvent::MouseMove: { updateMouseCursor(); diff --git a/libs/qsynedit/qsynedit/qsynedit.h b/libs/qsynedit/qsynedit/qsynedit.h index 8fa3c538..ee9d4176 100644 --- a/libs/qsynedit/qsynedit/qsynedit.h +++ b/libs/qsynedit/qsynedit/qsynedit.h @@ -808,10 +808,6 @@ protected: public: QVariant inputMethodQuery(Qt::InputMethodQuery property) const override; - // QWidget interface - const QFont &fontForNonAscii() const; - void setFontForNonAscii(const QFont &newFontForNonAscii); - int mouseSelectionScrollSpeed() const; void setMouseSelectionScrollSpeed(int newMouseSelectionScrollSpeed); diff --git a/libs/qsynedit/qsynedit_zh_CN.ts b/libs/qsynedit/qsynedit_zh_CN.ts index 8496a87c..2161a981 100644 --- a/libs/qsynedit/qsynedit_zh_CN.ts +++ b/libs/qsynedit/qsynedit_zh_CN.ts @@ -4288,29 +4288,29 @@ QSynedit::Document - + Can't open file '%1' for read! 无法读取文件"%1". - - + + Can't load codec '%1'! 无法加载字符编码"%1"! - + '%1' is a binaray File! This is a binaray File! '%1'是二进制文件! - + Can't open file '%1' for save! 无法保存文件"%1"! - + Data not correctly writed to file '%1'. 数据未能正确写入文件"%1"。 @@ -4318,10 +4318,9 @@ QSynedit::QSynEdit - The syntaxer seems to be in an infinite loop The highlighter seems to be in an infinite loop - 代码分析器似乎死循环了。 + 代码分析器似乎死循环了。