Skip to content

Welcome to Planet KDE

This is a feed aggregator that collects what the contributors to the KDE community are writing on their respective blogs, in different languages

Monday, 20 September 2021

Cross Compile to PinePhone Part Two Click Here for Part one So on part one, we managed to compile kalk with emulator, and generated ArchLinux package to install on our PinePhone. However, emulator is slow, and compiling with emulator isn’t cross compile. Today, we’ll be using real cross compiler to build kalk package. Setup the Toolchain and SDK To be able to cross compile, we need cross compiler and target platform’s libraries.

TLDR; research and development of a completely new OpenType layout rules for Malayalam traditional orthography.

Writing OpenType shaping rules is hard. Writing OpenType shaping rules for advanced (complex) scripts is harder. Writing OpenType shaping rules without causing any undesired ligature formations is even harder.

Background

The shaping rules for SMC fonts abiding v2 of Malayalam OpenType speification (mlm2 script tag) were polished in large part by me over many years, fixing shaping errors and undesired ligature formations. It still left some hard to fix bugs. Driven by the desire to fix such difficult bugs in RIT fonts and the copyright fiasco, I have set out to write a simplified OpenType shaping rules for Malayalam from scratch. Two major references helped in that quest: (1) a radically different approach I have tried few years ago but failed with mlym script tag (aka Windows XP era shaping); (b) a manuscript by R. Chithrajakumar of Rachana Aksharavedi who devised the ‘definitive character set’ for Malayalam script. The idea of ‘definitive character set’ is that it contains all the valid characters in a script and it doesn’t contain any (invalid) characters not in the script. By the definition; I wanted to create the new shaping rules in such a way that it does not generate any invalid characters (for e.g. with a detached u-kar).

Fig. 1. Samples of Malayalam definitive character set listing by R. Chithrajakumar, circa 1999. Source: K.H. Hussain.

“Simplify, simplify, simplify!”

Henry David Thoreau

It is my opinion that a lot of complexity in the Malayalam shaping largely comes from Indic OpenType shaping specification largely follows Devanagari, which in turn was adapted from ISCII, which has (in my limited understanding) its root in component-wise metal type design of ligature glyphs. Many half, postbase and other shaping rules have their lineage there. I have also heard similar concerns about complexity expressed by others, including Behdad Esfahbod, FreeFont maintainer et al.

Implementation

As K.H. Hussain once rightly noted, the shaping rules were creating many undesired/unnecessary ligature glyphs by default, and additional shaping rules (complex contextual lookups) are written to avoid/undo those. A better, alternate approach would be: simply don’t generate undesired ligatures in the first place.

“Invert, always invert.”

Carl Gustav Jacob Jacobi

Around December 2019, I set out to write a definitive set of OpenType shaping rules for traditional script set of Malayalam. Instead of relying on many different lookup types such as pref, pstf, blwf, pres, psts and myriad of complex contextual substitutions, the only type of lookup required was akhn — because the definitive character set contains all ligatures of Malayalm and those glyphs are designed in the font as a single glyph — no component based design.

The draft rules were written in tandem with RIT-Rachana redesign effort and tested against different shaping engines such as HarfBuzz, Allsorts, XeTeX, LuaHBTeX and DirectWrite/Uniscribe for Windows. Windows, being Windows (also being maintainers of OpenType specification), indeed did not work as expected adhering to the specification. Windows implementation clearly special cased the pstf forms of യ (Ya, 0D2F) and വ (Va, 0D35). To make single set of shaping rules work with all these shaping engines, the draft rules were slightly amended, et voila — it worked in all applications and OSen that use any of these shaping engines. It was decided to drop support for mlym script which was deprecated many years ago and support only mlm2 specification which fixed many unfixable shortcomings of mlym. One notable shaping engine which doesn’t work with these rules is Adobe text engine (Lipika?), but they have recently switched to HarfBuzz. That covers all major typesetting applications.

Testing fonts developed using this new set of shaping rules for Malayalam indeed showed that they do not generate any undesired ligatures in the first place. In addition, compared to the previous shaping rules, it gets rid of 70+ lines of complex contextual substitutions and other rules, while remaining easy to read and maintain.

Old vs new shaping rules in Rachana
Fig. 3. Old vs new shaping rules in RIT Rachana.

Application support

This new set of OpenType layout rules for Malayalam is tested to work 100% with following shaping engines:

  1. HarfBuzz
  2. Allsorts
  3. DirectWrite/Uniscribe (Windows shaping engine)

And GUI toolkits/applications:

  1. Qt (KDE applications)
  2. Pango/GTK (GNOME applications)
  3. LibreOffice
  4. Microsoft Office
  5. XeTeX
  6. LuaHBTeX
  7. Emacs
  8. Adobe InDesign (with HarfBuzz shaping engine)
  9. Adobe Photoshop
  10. Firefox, Chrome/Chromium, Edge browsers

Advantages

In addition, the advantages of the new shaping rules are:

  1. Adheres to the concept of ‘definitive character set’ of the language/script completely. Generate all valid conjunct characters and do not generate any invalid conjunct character.
  2. Same set of rules work fine without adjustments/reprogramming for ‘limited character set’ fonts. The ‘limited character set’ may not contain conjunct characters as extensive in the ‘definitive character set’; yet it would always have characters with reph and u/uu-kars formed correctly.
  3. Reduced complexity and maintenance (no complex contextual lookups, reverse chaining etc.). Write once, use in any fonts.
  4. Open source, libre software.

This new OpenType shaping rules program was released to public along with RIT Rachana few months ago, and also used in all other fonts developed by RIT. It is licensed under Open Font License for anyone to use and integrate into their fonts, please ensure the copyright statements are preserved. The shaping rules are maintained at RIT GitLab repository. Please create an issue in the tracker if you find any bugs; or send a merge request if any improvement is made.

I’m using for my own personal projects a generator for c++ preferences for quite a while, I’ll not say that it’s heavily tested as KConfigXT is, but it is also much more simple than it.

While talking about it to a fellow developer he asked me how hard it would be to port the thing to KConfig (as the main backend I used was QSettings) - and the result is quite nice, the port toook less than a day, and now my generator generates configurations for both KConfig and QSettings.

  • Example configuration:
preferences.conf

#include <QString>
#include <QStandardPaths>

Preferences {
    General {
        int beatsPerMinute = 60
    }
    Some {
        Inner {
            Group {
                int value = 10
            }
        }
    }
    Harmonica {
        QString partitureFolder = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)
    }
}

For those that worked with KConfigXT, it’s easy to see how much this is different from the xml that the tool uses. And differently from KConfigXT, the code is smaller, easier to read, and does not rely on magic enums, nor it has a lot of different possibilities to fine tune the settings - if you want to choose between runtime or compile time file, shared vs non shared config, etc.: KConfigXT is for you, mine is supposed to be simple and up to the point.

That Preferences will generate all the corresponding C++ classes with the needed boilerplate for a Qt application to handle settings, in a safe way - no more strings for keys on code.

Preferences::self()->some()->inner()->group()->setValue(15);
Preferences::self()->general()->setBeatsPerMinute(10);

All of the preferences are exported as Q_PROPERTIES using snake_case so you use it directly on Qml.

SomeQmlElement {
    width: preferences.window.width
}

If you want to set specific rules to the Preferences values, this is done in c++, using the setRule variants of the settings:

int main(int argc, char *argv[]) {
   QApplication app(argc, argv);
   Preferences::self()->some()->inner()->group()->setValueRule([](int value) { return value < 90; });
}

The defaut values can be queried with Default variants:

  Preferences::self()->some()->inner()->group->valueDefault();

There’s no code to automatically handle ui files, like KConfigXT, nor there will be. create your connects by hand using this.

The source is at https://github.com/tcanabrava/configuration-parser Currently the build produces two binaries: one for qsettings, one for kconfig.

(if anyone is better at cmake than myself, I’d appreicate some help on ConfigurationCompiler.cmake, as it’s not correctly generating the targets on a 3rd party project)

Sunday, 19 September 2021

My mom is moving house, which means that we’re packing things up. You could also call it cleaning up the cruft of a lifetime. From nooks and crannies come boxes of color slides – explain that concept to the kids, eh – and I’ve started scanning them. It’s a slow and laborious process, but yields some keen results.

Selfie, a few hours old
Selfie, a few hours old

Part of “slow” is transcribing the text from the slide windows; my dad’s handwriting is not always easy to decipher. It’s a good thing this picture was labeled (as “the project”, no less) and dated, so I know it’s the earliest photo of me.

Babies mostly look alike, blotchy and smooshed up.

The same box of slides also contains an Elk, midnight sun on Ellesmere Island, my mom bottle-feeding a goat in a kitchen, and this picture labeled “Mobil Rainbow 5-10-109-6W6”.

Mobil Rainbow 5-10-109-6W6
Mobil Rainbow 5-10-109-6W6

My dad was an oil geologist – not a popular job title now, 50 years later – and would spend months away from home doing field work. Much of it was in the Canadian Arctic. I think this is a beautiful picture, although I can’t tell if the reflection of the tower is in a lake, or an oil spill. It could be either.

Piecing together what was important for my parents from a box of slides – and at least I can still ask my mom to explain some things – is such a strange feeling, especially when I start to show up in the pictures; eventually memories intrude, like the flood of 1981.

I suppose the takeaway for this blog post is: share your stories while they still matter. (Not necessarily “share with the whole damn internet”, so I’ll be subjecting my mom and/or my kids to “way back in 1980” kinds of stories, not all y’allses)

Note: Kalendar is still under heavy development. You’re free to poke around and try it out, but it is not yet final software! If you want to contribute to its development, join us in Kalendar’s Matrix room. This week, we have once again included a big number of little UI changes that should make Kalendar …
Cross Compile to PinePhone Part One Click Here For PART TWO PinePhone has been out for over one year now. In the last year, KDE plasma mobile saw rapid progress. We’ve developed almost all utility apps you’d have on iOS and Android. And actions like flashlight, screen capture also get added to top panel. What’s more, the launch screen and app drawer only get better. When I started develop apps for PinePhone, I often find myself spent majority of time on PC.

Saturday, 18 September 2021

Are you using Kubuntu 21.04 Hirsute Hippo, our current Stable release? Or are you already running our development builds of the upcoming 21.10 Impish Indri?

We currently have Plasma 5.22.90 (Plasma 5.23 Anniversary Edition Beta)  available in our Beta PPA for Kubuntu 21.04, and 21.10 development series.

However this is a beta release, and we should re-iterate the disclaimer from the upstream release announcement:

DISCLAIMER: This is beta software and is released for testing purposes. You are advised to NOT use Plasma 25th Anniversary Edition Beta in a production environment or as your daily desktop. If you do install Plasma 25th Anniversary Edition Beta, you must be prepared to encounter (and report to the creators) bugs that may interfere with your day-to-day use of your computer.

https://kde.org/announcements/plasma/5/5.22.90

Note: Users of 21.04 Hirsute Hippo who have installed packages from the BETA PPA should run ‘sudo ppa-purge kubuntu-ppa/beta’ once they have finished testing, and before attempting to upgrade to 21.10 when it is released. Failure to do so is likely to break upgrades.

The PPA should work whether you are currently using our backports PPA or not.

Also Impish Indri 21.10 will ship with Plasma 5.22.5 by default. However we aim to make 5.23 available in the backports PPA soon after release. This testing will help that aim.

If you are prepared to test, then…..

Add the beta PPA and then upgrade:

sudo add-apt-repository ppa:kubuntu-ppa/beta && sudo apt full-upgrade -y

Then reboot.

In case of issues, testers should be prepared to use ppa-purge to remove the PPA and revert/downgrade packages.

Kubuntu is part of the KDE community, so this testing will benefit both Kubuntu as well as upstream KDE Plasma software, which is used by many other distributions too.

  • If you believe you might have found a packaging bug, you can use a launchpad.net to post testing feedback to the Kubuntu team as a bug, or give feedback on IRC [1], or mailing lists [2].
  • If you believe you have found a bug in the underlying software, then bugs.kde.org is the best place to file your bug report.

Please review the release announcement and changelog.

[Test Case]
* General tests:
– Does plasma desktop start as normal with no apparent regressions over 5.21 or 5.22?
– General workflow – testers should carry out their normal tasks, using the plasma features they normally do, and test common subsystems such as audio, settings changes, compositing, desktop affects, suspend etc.
* Specific tests:
– Check the changelog:
– Identify items with front/user facing changes capable of specific testing.
– Test the ‘fixed’ functionality or ‘new’ feature.

Testing may involve some technical set up to do, so while you do not need to be a highly advanced K/Ubuntu user, some proficiently in apt-based package management is advisable.

Testing is very important to the quality of the software Ubuntu and Kubuntu developers package and release.

We need your help to get this important beta release in shape for Kubuntu and the KDE community as a whole.

Thanks!

Please stop by the Kubuntu-devel IRC channel on libera.chat if you need clarification of any of the steps to follow.

[1] – #kubuntu-devel on libera.chat
[2] – https://lists.ubuntu.com/mailman/listinfo/kubuntu-devel

Sadly I have had to disable comments in my previous blog because there is a being [that probably passes by human if you look at them] that started with insults, continued with more insults and then graduated to physically threaten me.

 

I always thought it was obvious, but if you insult people or try to cause them phisical harm, they are usually less prone to think "oh you're right, you've convinced me" and more prone to think "this human needs to stop harassing me and sort out their problems".

KDE Frameworks provides a cross-platform notification API, and with a proposed change still in review this would also become directly usable from QML.

Basic Notifications

Getting started with notifications in QML would then be quite similar to how this also works in C++:

  • Create a KNotificiation instance.
  • Customize it to your needs via its properties (labels, icons, actions, priorities, etc).
  • Connect to its slots to react to the user interacting with the notification, by triggering its inline actions or by closing it.
  • Eventually call its sendEvent() method to show or re-show the notification.
import QtQuick 2.15
import org.kde.notification 1.0

... {
    Notification {
        id: myNotification
        componentName: "plasma_workspace"
        eventId: "notification"
        title: "Attention!"
        text: "Something important happened."
        iconName: "kde"
        actions: [ "Action 1", "Action 2" ]
        flags: Notification.Persistent
        urgency: Notification.HighUrgency
        onClosed: console.log("Notification closed.")
        onDefaultActivated: console.log("Default action activated.")
        onAction1Activated: console.log("Action 1 activated.")
        onAction2Activated: console.log("Action 2 activated.")
    }

    Button {
        onClicked: myNotification.sendEvent()
    }
}

Inline Reply Notifications

Inline reply notifications are also available. There’s a small difference to C++ in that the reply action doesn’t need to be explicitly managed but is created on demand behind the scenes.

import QtQuick 2.15
import org.kde.notification 1.0

... {
    Notification {
        id: myReplyNotification
        componentName: "plasma_workspace"
        eventId: "notification"
        title: "Chat message from Dr Konqui"
        text: "How are you?"
        replyAction {
            label: "Reply"
            placeholderText: "Reply to Dr Konqui..."
            submitButtonText: "Send Reply"
            submitButtonIconName: "mail-reply-all"
            onReplied: console.log(text)
        }
    }
}

Memory Management

If you are already familiar with KNotification’s C++ API you might notice that the use shown above shouldn’t actually be possible due to KNotification objects being auto-deleted after being closed.

Or you might have a use-case that requires an arbitrary amount of dynamically created notifications rather than a fixed set of reusable instances. In that case the above examples might seem too restrictive.

The answer to both is the new configurable auto-delete behavior of KNotification. When used from C++ it’s on by default for compatibility (but can also be switched off now), in QML it’s off by default and can be switched on when needed as shown in the following example.

import QtQuick 2.15
import org.kde.notification 1.0

... {
    Component {
        id: notificationComponent
        Notification {
            componentName: "plasma_workspace"
            eventId: "notification"
            text: "Temporary notification we can create new instances of."
            autoDelete: true
        }
    }

    Button {
        property int count: 0
        onClicked: {
            var notification = notificationComponent.createObject(parent);
            notification.title = "New Notification " + count;
            n.sendEvent();
            ++count;
        }
    }
}

There’s a more complete and actually runnable pure-QML example here.

KDE Frameworks 6

One of the goals for KDE Frameworks 6 is to have QML bindings directly integrated with the corresponding frameworks themselves. Doing this during the lifetime of 5 allows us to identify issues in the C++ API that we can then adjust in 6 to minimize the need for wrapper or glue code. This reduces maintenance cost and improves usability by making both APIs more similar.

Help with this is very welcome, check the KF6 workboard and consider joining the #kde-devel channel on Matrix, the weekly KF6 meeting (Monday 15:00 UTC) and the kde-frameworks-devel mailing list to discuss the details!

The Plasma 5.23 beta has been released, so go test it! We’ve got a month to fix all the bugs you find and report, so please do so. 🙂 Many of the improvements already made this week pertain to Plasma’s Wayland session which is rapidly becoming usable for more and more people’s daily usage. I’m using it myself as my primary session, and this is pretty painless now. I’m so impressed by how KDE developers have managed to whip it into shape over the last year! The future truly is now, or something.

Lots of other non-Wayland improvements were made as well:

New Features

KCalc now has a history view where you can see all recently-run calculations! (Antonio Prcela, KCalc 21.12):

This implements an 18 year-old feature request!

The standard “Share” menu found in various KDE apps now offers the possibility of generating a QR code when the thing being shared is a URL (Kai Uwe Broulik, Frameworks 5.87):

Bugfixes & Performance Improvements

In Gwenview, you can once again switch between the zoom modes with keyboard shortcuts after this broke recently (Eugene Popov, Gwenview 21.08.2)

The Previous and Next buttons in Elisa’s player control bar no longer inappropriately become disabled while the current track is paused (me: Nate Graham, Elisa 21.08.2)

Okular no longer lets you try to save over a read-only file, and instead prompts you to save the file elsewhere (Albert Astals Cid, Okular 21.08.2)

In the Plasma Wayland session, KWin no longer crashes when you disconnect a Bluetooth drawing tablet (Aleix Pol Gonzalez, Plasma 5.23)

System Settings no longer sometimes crashes when deleting certain cursor themes (David Edmundson, Plasma 5.23)

System Settings is now much faster to open top-level categories that have several sub-pages in them (Bharadwaj Raju, Plasma 5.23)

In the Plasma Wayland session, copying text from XWayland apps while Klipper’s “Prevent empty selection” setting is in use now works (David Edmundson, Plasma 5.23)

In the Plasma Wayland session, long menus in apps and sub-menus of the Kicker menu are no longer covered up by Plasma Panels (Andrey Butirsky, Plasma 5.23)

In the Plasma Wayland session, full-screen Chrome web apps should now display properly (Vlad Zahorodnii, Plasma 5.23)

In the Plasma Wayland session, windows that open to a size which is larger than the area they would be maximized to now get resized down to fit in that area (Aleix Pol Gonzalez, Plasma 5.23)

In the Plasma Wayland session, transparent Plasma themes now display transparency correctly when using the proprietary NVIDIA driver (Severin van Wnuck, Plasma 5.23)

Plasma Vaults no longer fail to mount if the mountpoint has a hidden .directory file in it because you browsed that location when using per-directory view settings while the Vault was unmounted (Tom Zander, Plasma 5.23)

Cursor themes with only one size now cause only the size combobox on System Settings’ Cursors page to be disabled, rather than all of the controls on its row (Bharadwaj Raju, Plasma 5.23)

The Link and Active Text colors are now readable in all four Breeze color schemes, fixing issues of unreadable text for apps that were using this color role. Note that you will need to re-apply the color scheme manually to pick up the changes due to this issue (me: Nate Graham, Plasma 5.23)

The very minimal contents of System Settings’ own settings window has been moved into its hamburger menu to make access more direct (Ismael Asensio, Plasma 5.24):

The properties dialog once again shows the filename for read-only files (Ahmad Samir, Frameworks 5.87)

File ACLs set via the properties dialog now get applied correctly if you re-open the properties dialog right after changing them (Ahmad Samir, Frameworks 5.87)

Expandable list items in the System Tray once again reserve enough space in the highlight effect to show all of the buttons inside it (me: Nate Graham, Frameworks 5.87)

Some textual headers in Kirigami-based apps that were supposed to be hidden are once again hidden (Devin Lin, Frameworks 5.87)

Narrow and mobile-style form layouts in Kirigami apps now have the correct spacing between items within groups (Ismael Asensio, Frameworks 5.87)

User Interface Improvements

Konsole’s default toolbar has been drastically improved and simplified by putting all of the layout and split-related items into a dropdown menu button (Nathan Sprangers, Konsole 21.12):

Gwenview no longer inappropriately switches to Browse mode when you press the Escape key to close the zoom level combobox’s popup (Gleb Popov, Gwenview 21.12)

Info Center’s S.M.A.R.T. Status page now lets you see more detailed nerdy information if you want (Harald Sitter, Plasma 5.23)

System Settings’ sidebar is now fully keyboard navigable with just the arrow keys (Arjen Hiemstra, Plasma 5.23)

The Breeze application style has gained the ability to display views in older QtWidgets-based apps with a more “frameless” style, such that adjacent views are separated from one another with a single separator line rather than inset frames, just like they are in our more modern QtQuick apps. Apps will need to opt into this change, and they will start doing so over the course of the next year or so (Jan Blackquill, Plasma 5.24):

Note that visuals are not 100% final and support in Dolphin is still in progress has not been merged yet; this is only a sneak peek!

It’s now possible to navigate between sidebar list items in Kirigami-based apps using the arrow and enter/return keys (Arjen Hiemstra, Frameworks 5.87)

We have reverted the recent change to use a gear-style spinner in Plasma for app loading and other spinning progress indicators. It looked okay in some contexts, but not others. We will find a better way (me: Nate Graham, Frameworks 5.87)

The Breeze icon theme now features icons for all of the different types of Godot Engine files (Michael Alexsander, Frameworks 5.87):

No longer will you be left waiting for Godot

…And everything else

Keep in mind that this blog only covers the tip of the iceberg! Tons of KDE apps whose development I don’t have time to follow aren’t represented here, and I also don’t mention backend refactoring, improved test coverage, and other changes that are generally not user-facing. If you’re hungry for more, check out https://planet.kde.org/, where you can find blog posts by other KDE contributors detailing the work they’re doing.

How You Can Help

Have a look at https://community.kde.org/Get_Involved to discover ways to be part of a project that really matters. Each contributor makes a huge difference in KDE; you are not a number or a cog in a machine! You don’t have to already be a programmer, either. I wasn’t when I got started. Try it, you’ll like it! We don’t bite!

Finally, consider making a tax-deductible donation to the KDE e.V. foundation.