summaryrefslogtreecommitdiff
path: root/Userland/Applications/FontEditor/main.cpp
AgeCommit message (Collapse)Author
2023-05-19Applications: Improve FSAC error message handlingthankyouverycool
Fixes apps showing redundant error messages and terminating unnecessarily on failed file requests. It's nicer to drop the user off at the equivalent of a default document on failure if possible. Also fixes TextEditor not showing response errors for missing files in the recently opened list.
2023-05-17FontEditor: Show recently opened files in File menuthankyouverycool
And update GlyphEditorWidget on initialize(). Fixes Editor not showing the new active glyph when loading recent fonts from a menu.
2023-05-13FontEditor: Allow application to launch without a fontthankyouverycool
Since LibFSAC requires a reified window before loading a font, it makes sense to have a safe null state for the app. This lets us stay alive after a failed file request on startup, handle failure at any point during initialization, and claw back memory from all our font RefPtrs. A default startup font or none at all can now be set in FontEditor.ini
2023-05-13FontEditor: Don't crash on missing iconsthankyouverycool
Instead of crashing on failed icon loading with TRY(), let's report missing but non-critical resources in detail and gracefully move on.
2023-05-05LibGUI: Make `Application`'s construction fallibleLucas CHOLLET
The pattern to construct `Application` was to use the `try_create` method from the `C_OBJECT` macro. While being safe from an OOM perspective, this method doesn't propagate errors from the constructor. This patch make `Application` use the `C_OBJECT_ABSTRACT` and manually define a `create` method that can bubble up errors from the construction stage. This commit also removes the ability to use `argc` and `argv` to create an `Application`, only `Main`'s `Arguments` can be used. From a user point of view, the patch renames `try_create` => `create`, hence the huge number of modified files.
2023-05-05FontEditor: Use `LibFileSystemAccessClient`Caoimhe
2023-04-25Applications: Update man page links for applicationsTim Ledbetter
This commit updates all application man page links to point to the Applications subdirectory.
2023-03-01LibCore+Everywhere: Remove ArgsParser::add*(char const*&)Ali Mohammad Pur
This is not guaranteed to always work correctly as ArgsParser deals in StringViews and might have a non-properly-null-terminated string as a value. As a bonus, using StringView (and DeprecatedString where necessary) leads to nicer looking code too :^)
2023-01-06LibGUI+Everywhere: Use fallible Window::set_main_widget() everywhere :^)Sam Atkins
Rip that bandaid off! This does the following, in one big, awkward jump: - Replace all uses of `set_main_widget<Foo>()` with the `try` version. - Remove `set_main_widget<Foo>()`. - Rename the `try` version to just be `set_main_widget` because it's now the only one. The majority of places that call `set_main_widget<Foo>()` are inside constructors, so this unfortunately gives us a big batch of new `release_value_but_fixme_should_propagate_errors()` calls.
2022-12-20FontEditor: Remove unused includesthankyouverycool
2022-09-29AK+Everywhere: Replace "protocol" with "scheme" url helpersnetworkException
URL had properly named replacements for protocol(), set_protocol() and create_with_file_protocol() already. This patch removes these function and updates all call sites to use the functions named according to the specification. See https://url.spec.whatwg.org/#concept-url-scheme
2022-08-04FontEditor: Improve error handling opening, saving and editing fontsthankyouverycool
Adds fallible functions for opening and saving fonts and cutting and copying selections. FontEditor now falls back on a guaranteed default BitmapFont on startup. Fixes crashing on start when the default system font is set to TrueType.
2022-07-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
2022-07-06FontEditor: Rename FontEditorWidget => FontEditor::MainWidgetthankyouverycool
2022-07-06FontEditor: Update GML for new layout systemthankyouverycool
This patch removes deprecated GML properties and manual sizing calculations in favor of the new UIDimensions, and registers more widgets in the FontEditor namespace to simplify widget setup.
2022-07-06FontEditor: Improve error propagation during constructionthankyouverycool
FontEditor now builds its actions, toolbars, models and menus with fallible methods. Widget assignment from GML is now organized in order of use.
2022-04-09LibGfx: Move other font-related files to LibGfx/Font/Simon Wanner
2022-02-18FontEditor: Remove listener clientthankyouverycool
FontEditor was relying on a hack to get notified about i32 config changes, and scale is not a setting we want updated across all editor instances, nor do we have any settings that make sense to monitor universally, so let's remove listener privileges for now.
2022-02-15FontEditor: Add a ListView to sort glyphs by their Unicode blockthankyouverycool
2022-02-11LibConfig: Rename pledge_domains(String) => pledge_domain(String)Vitaly Dyachkov
pledge_domains() that takes only one String argument was specifically added as a shortcut for pledging a single domain. So, it makes sense to use singular here.
2022-01-09FontEditor: Propagate errors using try_set_main_widget in maincreator1creeper1
2022-01-09FontEditor: Save scale to config fileMaciej
2021-12-30Userland: Link directly against LibUnicodeData where neededTimothy Flynn
This is partially a revert of commits: 10a8b6d4116c6a627a6c189154af032f69b29c21 561b67a1add82538502ef2f5733f1d86718898ad Rather than adding the prot_exec pledge requried to use dlopen(), we can link directly against LibUnicodeData in applications that we know need that library. This might make the dlopen() dance a bit unnecessary. The same purpose might now be fulfilled with weak symbols. That can be revisted next, but for now, this at least removes the potential security risk of apps like the Browser having prot_exec privileges.
2021-12-21Userland: Add unveil/pledge requisites for dynamic Unicode data loadingTimothy Flynn
Loading libunicodedata.so will require dlopen(), which in turn requires mmap(). The 'prot_exec' pledge is needed for this. Further, the .so itself must be unveiled for reading. The "real" path is unveiled (libunicodedata.so.serenity) as the symlink (libunicodedata.so) itself cannot be unveiled.
2021-11-30FontEditor: Convert to east constthankyouverycool
2021-11-30FontEditor: Simplify start-upthankyouverycool
Previusly a cloned or newly loaded font was moved twice from main to the constructor and then from constructor to an init routine where it was finally used. The unmasked font is now moved only once, directly to initialization, and redundant error checking is discarded.
2021-11-28Everywhere: Use default execpromises argument for Core::System::pledgeBrian Gianforcaro
2021-11-24LibDesktop: Make allowlist APIs return ErrorOr<void>Andreas Kling
This makes it very smooth to use TRY() when setting up these lists, as you can see in the rest of this commit. :^)
2021-11-24FontEditor: Port to LibMain :^)Andreas Kling
2021-09-19FontEditor: Update editor to handle new font formatthankyouverycool
The editor now unmasks fonts on load, mapping their glyphs to the complete unicode character set, and masks them upon saving to reduce disk space. This is a naive approach in terms of memory usage and can be improved but whose immediate goal is to allow editing any glyph without concern for range allocation.
2021-08-27FontEditor: Let WindowServer manage modified markingsthankyouverycool
Simplifies building modified/new font titles and lets FontEditor make use of the comfy ellipsis close button.
2021-07-21Userland: Add GUI::Window::add_menu() and use it everywhereAndreas Kling
Applications previously had to create a GUI::Menubar object, add menus to it, and then call GUI::Window::set_menubar(). This patch introduces GUI::Window::add_menu() which creates the menubar automatically and adds items to it. Application code becomes slightly simpler as a result. :^)
2021-05-15FontEditor: Add missing `unix` pledgeDaniel Bertalan
Without this change, FontEditor would crash due to LibDesktop opening an IPC connection. Fixes #7137.
2021-05-13Userland: Tighten a *lot* of pledges! :^)Andreas Kling
Since applications using Core::EventLoop no longer need to create a socket in /tmp/rpc/, and also don't need to listen for incoming connections on this socket, we can remove a whole bunch of pledges!
2021-04-26FontEditor: Warn on unsaved changesthankyouverycool
Standardizes saving conventions: Editor now warns on close, new, and open if there are unsaved changes, and new files prompt to Save As.
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-13Everywhere: It's now "Foobar", not "FooBar", and not "foo bar"Andreas Kling
I hereby declare these to be full nouns that we don't split, neither by space, nor by underscore: - Breadcrumbbar - Coolbar - Menubar - Progressbar - Scrollbar - Statusbar - Taskbar - Toolbar This patch makes everything consistent by replacing every other variant of these with the proper one. :^)
2021-04-11FontEditor: Move menu bar into editor and tweak several widgetsthankyouverycool
Actions are now shared between menu bar and toolbar. Adds an edit menu to complement toolbar actions. Glyphs are now passed as ints instead of u8s; fixes Latin Extended+ glyphs failing to update in real time on map. Converts weight and type to more human-readable combo box lists. Selected glyph now scrolls into view on load.
2021-04-10FontEditor: Alt shortcuts and book title capitalization in menusAndreas Kling
2021-04-09FontEditor: Added quick and dirty support to add cyrrilic fonts.Dmitrii Trifonov
This is a hack to support cyrillic text in serenity OS.
2021-04-06FontEditor: Convert to GML and add new edit commands to GlyphEditorthankyouverycool
Adds cut, copy, paste and delete to GlyphEditor. Font preview has moved to a separate resizable ToolWindow. Font metadata can now be hidden. FontEditor and glyph widgets can now be re-initialized instead of resetting window's main widget after loading new fonts.
2021-03-30FontEditor+TextEditor+Playground: Refuse to load device filesIdan Horowitz
This prevents the undefined behaviour that would come up as a result of doing so. (For example: opening "infinite" devices like /dev/full will result in an infinite loop until exhaustion of memory)
2021-03-25Userland: Turn all application menus into window menus :^)Andreas Kling
2021-03-12Everywhere: Remove klog(), dbg() and purge all LogStream usage :^)Andreas Kling
Good-bye LogStream. Long live AK::Format!
2021-02-15LibGfx: Remove static load_from_file() from abstract Font classStephan Unverwerth
2021-01-16Everywhere: Drop "shared_buffer" in most GUI programs, pledge "recvfd"Andreas Kling
Now that WindowServer broadcasts the system theme using an anonymous file, we need clients to pledge "recvfd" so they can receive it. Some programs keep the "shared_buffer" pledge since it's still used for a handful of things.
2021-01-15Everywhere: Pledge "sendfd" in WindowServer client programsAndreas Kling
This is needed for the new way we transfer window backing stores.
2021-01-12Applications: Move to Userland/Applications/Andreas Kling