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