- enhancement: Display ascii control chars.
This commit is contained in:
parent
451e201881
commit
bc0d55b1bb
1
NEWS.md
1
NEWS.md
|
@ -10,6 +10,7 @@ Red Panda C++ Version 2.27
|
|||
- enhancement: Support unicode combining characters.
|
||||
- enhancement: Don't force fixed-width when using non fixed-width fonts.
|
||||
- change: Replace non-ascii font with fallback font.
|
||||
- enhancement: Display ascii control chars.
|
||||
|
||||
Red Panda C++ Version 2.26
|
||||
- enhancement: Code suggestion for embedded std::vectors.
|
||||
|
|
|
@ -555,6 +555,7 @@ else: unix:!android: target.path = $${PREFIX}/bin
|
|||
!isEmpty(target.path): INSTALLS += target
|
||||
|
||||
RESOURCES += \
|
||||
fonts.qrc \
|
||||
codes.qrc \
|
||||
defaultconfigs.qrc \
|
||||
icons.qrc \
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<RCC>
|
||||
<qresource prefix="/fonts">
|
||||
<file alias="asciicontrol.ttf">resources/fonts/asciicontrol.ttf</file>
|
||||
</qresource>
|
||||
</RCC>
|
|
@ -46,6 +46,7 @@
|
|||
#include <QSharedMemory>
|
||||
#include <QBuffer>
|
||||
#include <winuser.h>
|
||||
#include <QFontDatabase>
|
||||
|
||||
#include "widgets/cpudialog.h"
|
||||
#endif
|
||||
|
@ -404,6 +405,7 @@ int main(int argc, char *argv[])
|
|||
e.reason(),
|
||||
QMessageBox::Ok);
|
||||
}
|
||||
// qDebug()<<"Load font"<<QFontDatabase::addApplicationFont(":/fonts/asciicontrol.ttf");
|
||||
|
||||
MainWindow mainWindow;
|
||||
pMainWindow = &mainWindow;
|
||||
|
|
Binary file not shown.
|
@ -723,6 +723,7 @@ QStringList Settings::Editor::fontFamilies() const
|
|||
result.append(mFallbackFontName2);
|
||||
if (mUseFallbackFont3)
|
||||
result.append(mFallbackFontName3);
|
||||
result.append("Red Panda Control");
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -669,8 +669,8 @@ void Document::loadFromFile(const QString& filename, const QByteArray& encoding,
|
|||
} else if (line.endsWith("\n")){
|
||||
line.remove(line.length()-1,1);
|
||||
}
|
||||
if (isBinaryContent(line))
|
||||
throw BinaryFileError(tr("'%1' is a binaray File!").arg(filename));
|
||||
// if (isBinaryContent(line))
|
||||
// throw BinaryFileError(tr("'%1' is a binaray File!").arg(filename));
|
||||
if (allAscii) {
|
||||
allAscii = isTextAllAscii(line);
|
||||
}
|
||||
|
|
|
@ -724,17 +724,15 @@ QStringList absolutePaths(const QString &dirPath, const QStringList &relativePat
|
|||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool isBinaryContent(const QByteArray &text)
|
||||
{
|
||||
for (char c:text) {
|
||||
if (c>=0 && c<' ' && c!='\t' && c!='\n' && c!='\r') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// bool isBinaryContent(const QByteArray &text)
|
||||
// {
|
||||
// for (char c:text) {
|
||||
// if (c>=0 && c<' ' && c!='\t' && c!='\n' && c!='\r') {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
|
||||
void clearQPlainTextEditFormat(QTextEdit *editor)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue