Upped version number, improved text selection, and replaced noto kufi arabic with amiri

This commit is contained in:
Yousef Khadadeh 2025-12-02 11:05:16 +03:00
parent 716f9222dc
commit 6b9a0562f6
11 changed files with 37 additions and 22 deletions

View file

@ -189,8 +189,8 @@ elseif(APPLE)
BUNDLE True BUNDLE True
MACOSX_BUNDLE_GUI_IDENTIFIER com.erroratline0.infinipaint MACOSX_BUNDLE_GUI_IDENTIFIER com.erroratline0.infinipaint
MACOSX_BUNDLE_BUNDLE_NAME infinipaint MACOSX_BUNDLE_BUNDLE_NAME infinipaint
MACOSX_BUNDLE_BUNDLE_VERSION "0.3.0" MACOSX_BUNDLE_BUNDLE_VERSION "0.3.1"
MACOSX_BUNDLE_SHORT_VERSION_STRING "0.3.0" MACOSX_BUNDLE_SHORT_VERSION_STRING "0.3.1"
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/macosinstall/Info.plist MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/macosinstall/Info.plist
) )
add_custom_command(TARGET infinipaint POST_BUILD add_custom_command(TARGET infinipaint POST_BUILD
@ -361,7 +361,7 @@ if(APPLE OR WIN32)
set(CPACK_PACKAGE_NAME "infinipaint") set(CPACK_PACKAGE_NAME "infinipaint")
set(CPACK_PACKAGE_VERSION_MAJOR "0") set(CPACK_PACKAGE_VERSION_MAJOR "0")
set(CPACK_PACKAGE_VERSION_MINOR "3") set(CPACK_PACKAGE_VERSION_MINOR "3")
set(CPACK_PACKAGE_VERSION_PATCH "0") set(CPACK_PACKAGE_VERSION_PATCH "1")
set(CPACK_PACKAGE_VENDOR "ErrorAtLine0") set(CPACK_PACKAGE_VENDOR "ErrorAtLine0")
set(CPACK_PACKAGE_CONTACT "erroratline0@gmail.com") set(CPACK_PACKAGE_CONTACT "erroratline0@gmail.com")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")

Binary file not shown.

View file

@ -1,4 +1,4 @@
Copyright 2022 The Noto Project Authors (https://github.com/notofonts/arabic) Copyright 2010-2022 The Amiri Project Authors (https://github.com/aliftype/amiri).
This Font Software is licensed under the SIL Open Font License, Version 1.1. This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at: This license is copied below, and is also available with a FAQ at:

View file

@ -59,6 +59,18 @@
<launchable type="desktop-id">com.infinipaint.infinipaint.desktop</launchable> <launchable type="desktop-id">com.infinipaint.infinipaint.desktop</launchable>
<releases> <releases>
<release version="0.3.1" date="2025-12-02">
<description>
<p>Minor update:</p>
<ul>
<li>Add right click popup menu for selection and text editing</li>
<li>Fixed crash when pasting rich text in GUI textbox</li>
<li>Added mouse double click and triple click text selection</li>
<li>Can now type tabs into textboxes</li>
<li>Replaced an embedded font</li>
</ul>
</description>
</release>
<release version="0.3.0" date="2025-11-23"> <release version="0.3.0" date="2025-11-23">
<description> <description>
<p>Major update:</p> <p>Major update:</p>

View file

@ -13,9 +13,9 @@
<key>CFBundleSpokenName</key> <key>CFBundleSpokenName</key>
<string>InfiniPaint</string> <string>InfiniPaint</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>0.3.0</string> <string>0.3.1</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>0.3.0</string> <string>0.3.1</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>NSHumanReadableCopyright</key> <key>NSHumanReadableCopyright</key>

View file

@ -57,7 +57,7 @@ FontData::FontData()
map["Roboto"] = defaultFontMgr->makeFromFile("data/fonts/Roboto-variable.ttf"); map["Roboto"] = defaultFontMgr->makeFromFile("data/fonts/Roboto-variable.ttf");
collection = sk_make_sp<skia::textlayout::FontCollection>(); collection = sk_make_sp<skia::textlayout::FontCollection>();
collection->setDefaultFontManager(defaultFontMgr, std::vector<SkString>{SkString{"Roboto"}, SkString{"Noto Emoji"}, SkString{"Noto Kufi Arabic"}}); collection->setDefaultFontManager(defaultFontMgr, std::vector<SkString>{SkString{"Roboto"}, SkString{"Noto Emoji"}, SkString{"Amiri"}});
if(localFontMgr) if(localFontMgr)
collection->setDynamicFontManager(localFontMgr); collection->setDynamicFontManager(localFontMgr);
std::string s = "🙂"; std::string s = "🙂";
@ -74,7 +74,7 @@ const std::vector<SkString>& FontData::get_default_font_families() const {
defaultFontFamilies.emplace_back("Roboto"); defaultFontFamilies.emplace_back("Roboto");
if(fallbackOnEmoji) if(fallbackOnEmoji)
defaultFontFamilies.emplace_back("Noto Emoji"); defaultFontFamilies.emplace_back("Noto Emoji");
defaultFontFamilies.emplace_back("Noto Kufi Arabic"); defaultFontFamilies.emplace_back("Amiri");
} }
return defaultFontFamilies; return defaultFontFamilies;
} }
@ -83,7 +83,7 @@ void FontData::push_default_font_families(std::vector<SkString>& fontFamilies) c
fontFamilies.emplace_back("Roboto"); fontFamilies.emplace_back("Roboto");
if(fallbackOnEmoji) if(fallbackOnEmoji)
fontFamilies.emplace_back("Noto Emoji"); fontFamilies.emplace_back("Noto Emoji");
fontFamilies.emplace_back("Noto Kufi Arabic"); fontFamilies.emplace_back("Amiri");
} }
FontData::~FontData() { FontData::~FontData() {

View file

@ -174,28 +174,31 @@ void TextBox::process_key_input(Cursor& cur, InputKey in, bool ctrl, bool shift,
} }
void TextBox::process_mouse_left_button(Cursor& cur, const Vector2f& pos, int clickCount, bool held, bool shift) { void TextBox::process_mouse_left_button(Cursor& cur, const Vector2f& pos, int clickCount, bool held, bool shift) {
if(!held) if(clickCount == 1)
lastClicksWhileHeld = clickCount; lastClicksAtCursorPos = 1;
else else if(clickCount >= 2) {
lastClicksWhileHeld = std::max(lastClicksWhileHeld, clickCount); lastClicksAtCursorPos++;
if(lastClicksAtCursorPos > 3)
lastClicksAtCursorPos = 1;
}
if(lastClicksWhileHeld || held) { if(clickCount || held) {
rebuild(); rebuild();
Cursor oldCursor = cur; Cursor oldCursor = cur;
cur.pos = get_text_pos_closest_to_point(pos); cur.pos = get_text_pos_closest_to_point(pos);
if(lastClicksCursorPos != cur.pos && clickCount) { if(lastClicksCursorPos != cur.pos && clickCount) {
lastClicksWhileHeld = std::min(1, lastClicksWhileHeld); lastClicksAtCursorPos = 1;
lastClicksCursorPos = cur.pos; lastClicksCursorPos = cur.pos;
} }
cur.selectionBeginPos = cur.pos; cur.selectionBeginPos = cur.pos;
if(lastClicksWhileHeld && !shift) { if(lastClicksAtCursorPos && !shift) {
if(!cur.selectionEndPosBeforeHeld.has_value()) { if(!cur.selectionEndPosBeforeHeld.has_value()) {
cur.selectionEndPos = cur.selectionBeginPos; cur.selectionEndPos = cur.selectionBeginPos;
cur.selectionEndPosBeforeHeld = cur.selectionEndPos; cur.selectionEndPosBeforeHeld = cur.selectionEndPos;
} }
if(lastClicksWhileHeld == 3) { if(lastClicksAtCursorPos == 3) {
cur.selectionEndPos = cur.selectionEndPosBeforeHeld.value(); cur.selectionEndPos = cur.selectionEndPosBeforeHeld.value();
if(cur.selectionBeginPos < cur.selectionEndPos) { if(cur.selectionBeginPos < cur.selectionEndPos) {
cur.selectionBeginPos.fTextByteIndex = 0; cur.selectionBeginPos.fTextByteIndex = 0;
@ -206,7 +209,7 @@ void TextBox::process_mouse_left_button(Cursor& cur, const Vector2f& pos, int cl
cur.selectionEndPos.fTextByteIndex = 0; cur.selectionEndPos.fTextByteIndex = 0;
} }
} }
else if(lastClicksWhileHeld == 2) { else if(lastClicksAtCursorPos == 2) {
cur.selectionEndPos = cur.selectionEndPosBeforeHeld.value(); cur.selectionEndPos = cur.selectionEndPosBeforeHeld.value();
if(cur.selectionBeginPos < cur.selectionEndPos) { if(cur.selectionBeginPos < cur.selectionEndPos) {
cur.selectionBeginPos = move(Movement::LEFT_WORD_TIGHT, cur.selectionBeginPos); cur.selectionBeginPos = move(Movement::LEFT_WORD_TIGHT, cur.selectionBeginPos);

View file

@ -186,7 +186,7 @@ class TextBox {
unsigned tabWidth = 4; unsigned tabWidth = 4;
std::shared_ptr<FontData> fontData; std::shared_ptr<FontData> fontData;
int lastClicksWhileHeld = 0; int lastClicksAtCursorPos = 0;
TextPosition lastClicksCursorPos{0, 0}; TextPosition lastClicksCursorPos{0, 0};
struct ParagraphData { struct ParagraphData {

View file

@ -11,6 +11,6 @@ namespace VersionConstants {
constexpr int SAVEFILE_HEADER_LEN = 12; // DO NOT CHANGE THIS HEADER LENGTH constexpr int SAVEFILE_HEADER_LEN = 12; // DO NOT CHANGE THIS HEADER LENGTH
const std::string CURRENT_SAVEFILE_HEADER = "INFPNT000004"; // Change whenever the save file is incompatible with the previous version const std::string CURRENT_SAVEFILE_HEADER = "INFPNT000004"; // Change whenever the save file is incompatible with the previous version
const std::string CURRENT_VERSION_STRING = "0.3.0"; const std::string CURRENT_VERSION_STRING = "0.3.1";
constexpr VersionNumber CURRENT_VERSION_NUMBER(0, 3, 0); constexpr VersionNumber CURRENT_VERSION_NUMBER(0, 3, 1);
} }

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="0.3.0.0" processorArchitecture="*" name="com.infinipaint.infinipaint" type="win32" /> <assemblyIdentity version="0.3.1.0" processorArchitecture="*" name="com.infinipaint.infinipaint" type="win32" />
<application xmlns="urn:schemas-microsoft-com:asm.v3"> <application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings> <windowsSettings>
<!-- Enable UTF-8 --> <!-- Enable UTF-8 -->