thankyouverycool
541f1de3a8
FontEditor: Add scaled offset members to GlyphEditor
...
Previously these were undescriptive globals making them a bit cryptic.
2021-11-30 10:51:51 +01:00
thankyouverycool
aa09e40eb2
FontEditor: Update status bar on initialization
...
Fixes incorrect glyph status immediately after loading a new font.
2021-11-30 10:51:51 +01:00
thankyouverycool
ae922c67fd
FontEditor: Remove code duplication when resizing GlyphEditor
...
The left column now also enforces a minimum width to prevent especially
small fonts from hiding the glyph toolbars and width widgets.
2021-11-30 10:51:51 +01:00
thankyouverycool
c1744822a1
FontEditor: Account for glyph width when pasting
...
Fixes glyphs not expanding up to their maximum width if necessary
when pasting larger glyphs into smaller ones.
2021-11-30 10:51:51 +01:00
thankyouverycool
281805696b
FontEditor: Don't allow cutting and copying absent glyphs
...
And update status bar on cut. Fixes placing these effectless actions
on the undo stack.
2021-11-30 10:51:51 +01:00
thankyouverycool
d2b211f14a
FontEditor: Don't null check newly created NonnullRefPtr fonts
2021-11-30 10:51:51 +01:00
thankyouverycool
74938e6f42
FontEditor: Factor out redundant code for a request to close
2021-11-30 10:51:51 +01:00
thankyouverycool
1e052f5a91
FontEditor: Convert mode and transform buttons into toolbar actions
...
This will let us more easily organize and assign shortcuts to new
modes and transformations as they are built, and it generally looks
more polished as a uniform interface. Also adds a counterclockwise
option to the rotate action, moves Copy as Character to the edit
menu as it doesn't directly impact GlyphEditor, and makes the paint
and move modes exclusive checkables to make the editor's state more
visually obvious.
2021-11-30 10:51:51 +01:00
thankyouverycool
922e80e72b
FontEditor: Simplify start-up
...
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-30 10:51:51 +01:00
thankyouverycool
56a8a2b493
FontEditor: Use LibUnicode to convert character case
...
Fixes characters beyond the Basic Latin code block not showing
their upper-case form in the preview window.
2021-11-30 10:51:51 +01:00
thankyouverycool
edf86af4f4
LibGfx+FontEditor: Add helper to determine raw glyph presence
...
GlyphBitmaps are considered present if they have a width greater
than zero. This adds a counterpart method for raw (unmasked) glyphs
and makes intent more explicit throughout FontEditor.
2021-11-30 10:51:51 +01:00
Brian Gianforcaro
cf4fa936be
Everywhere: Use default execpromises argument for Core::System::pledge
2021-11-28 08:04:57 +01:00
Andreas Kling
b6f49924be
LibDesktop: Make allowlist APIs return ErrorOr<void>
...
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-24 00:25:23 +01:00
Andreas Kling
ba4fd8fa15
FontEditor: Port to LibMain :^)
2021-11-24 00:25:23 +01:00
Ben Wiederhake
69cbaac50a
FontEditor: Make glyph parsing more robust
...
In particular, we sanity-check the received width, height, and buffer
size, before allocating.
2021-11-21 11:49:06 +00:00
Ben Wiederhake
f22c0ffe0c
LibGUI+Everywhere: Make sync requests to Clipboard server more obvious
2021-11-21 11:49:06 +00:00
Ben Wiederhake
d29f094ffa
FontEditor: Make paste access to Clipboard atomic
...
This avoids data race issues and saves three out of four synchronous
requests to the ClipboardServer.
2021-11-21 11:49:06 +00:00
Ben Wiederhake
63078ba7fc
FontEditor: Set all pixels when pasting a glyph
...
For an empty glyph (all pixels initially clear), this makes no
difference. However, if the glyph for the selected code point already
contains some set pixels, pasting used to "add" the set pixels, instead
of overwriting.
2021-11-20 12:56:35 +01:00
Ben Wiederhake
8d80d1346d
FontEditor: Add ability to copy the selected code point
...
This makes it easier to preview the current glyph, if it is not easily
typable.
2021-11-20 12:56:35 +01:00
Ben Wiederhake
7180813cd4
FontEditor: Support flipping and rotating
...
This is especially useful for highly symmetric scripts like this:
https://www.unicode.org/charts/PDF/U1400.pdf
2021-11-20 12:56:35 +01:00
Ben Wiederhake
1dfb3ff4eb
FontEditor: Tighten type of UndoGlyph::undo_state (cannot fail)
2021-11-20 12:56:35 +01:00
Ben Wiederhake
bce5a0a00d
FontEditor: Don't show focus box after clicking 'present' checkbox
2021-11-20 12:56:35 +01:00
Ben Wiederhake
197b5f7c4a
FontEditor: More reasonable labels, move property to GML
2021-11-20 12:56:35 +01:00
Ben Wiederhake
a8c95097b5
FontEditor: Convert UI from fixed to implicit height
...
This gets rid of a magic number, and means that the widget will adapt
nicely when the system font changes.
2021-11-20 12:56:35 +01:00
Ben Wiederhake
b224efe73b
FontEditor: Show code point name in status bar
2021-11-20 00:31:55 +01:00
Andreas Kling
a7f1f1c34b
LibCore: Use ErrorOr<T> for Core::File::open()
2021-11-08 00:35:27 +01:00
Andreas Kling
235f39e449
LibGfx: Use ErrorOr<T> for Bitmap::try_load_from_file()
...
This was used in a lot of places, so this patch makes liberal use of
ErrorOr<T>::release_value_but_fixme_should_propagate_errors().
2021-11-08 00:35:27 +01:00
FrHun
54605794f9
Applications: Remove border from GroupBox margins
2021-11-03 16:13:19 +01:00
Filiph Sandström
d6a0726302
Everywhere: Rename left/right-click to primary/secondary
...
This resolves #10641 .
2021-10-27 22:05:58 +03:00
Karol Kosek
0a54a86a8b
FontEditor: Accept file drops
2021-10-17 13:53:08 +01:00
Karol Kosek
a0cb8cfefd
FontEditor: Add FontEditorWidget::open_file() function
...
This part is also quite needed when opening files from drag-and-drop
events.
2021-10-17 13:53:08 +01:00
Karol Kosek
72378fd36c
FontEditor: Reuse the request_close() function in Open action
2021-10-17 13:53:08 +01:00
Gal Horowitz
cfc5df27f0
FontEditor: Close preview window when the main window is closed
2021-10-02 20:55:14 +02:00
thankyouverycool
fde48f1a7a
FontEditor: Allow editing new font header
...
And make use of mapping functions moved from
LibGUI/FontPickerWeightModel.h => LibGfx/FontStyleMapping.h
2021-09-24 14:59:39 +02:00
thankyouverycool
bbaebdcd00
FontEditor: Keep selected glyph in view on resize
2021-09-22 21:35:42 +02:00
thankyouverycool
efe44451ca
FontEditor: Make update_{statusbar,preview} member functions
...
For use outside constructor. Renames demo to preview to make
the UI and code comport.
2021-09-22 21:35:42 +02:00
thankyouverycool
e8f3fda3cf
FontEditor: Remove reprobe_font()
...
This was used to update GlyphMapWidget on Type changes and is
no longer needed since removal of Type enumeration in bb592ae
.
2021-09-22 21:35:42 +02:00
thankyouverycool
144d32d537
FontEditor: Sanitize RTL and control glyphs in Clipboard metadata
...
Fixes display issues in ClipboardHistory.
2021-09-22 21:35:42 +02:00
thankyouverycool
0a4640e892
FontEditor: Put glyph width changes on the undo stack
...
And select the restored glyph on undo/redo.
2021-09-22 21:35:42 +02:00
thankyouverycool
1ae4caca4b
FontEditor: Set width to zero when deleting a glyph
...
Previously, Delete left a glyph's width maximized.
2021-09-22 21:35:42 +02:00
thankyouverycool
ca6cb6cec3
FontEditor: Simplify initialization by disabling widget callbacks
...
Reduces some complexity dealing with callback effects and fixes
redundant calls to update_title and erroneously set glyph widths.
2021-09-22 21:35:42 +02:00
thankyouverycool
dc65535b7c
FontEditor: Add new tools to navigate code points
...
Visible glyphs can now be cycled through, or a code point specified
and jumped to directly.
2021-09-19 00:58:59 +02:00
thankyouverycool
a486415f03
FontEditor: Update editor to handle new font format
...
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-09-19 00:58:59 +02:00
Mustafa Quraish
0f749681a9
Everywhere: Use my fancy new serenityos.org email :^)
2021-09-13 20:51:50 +00:00
Mustafa Quraish
c1ede97543
FontEditor: Don't loop over all glyphs to find selected one
...
Previously we would loop over all glyphs in the GlyphMap, compute
their rects, and then test to see if the mouse click position was
inside that rect. This is silly since each element in the glyph
map for a particular font is the same size, and we can just do
some coordinate manipulation to get the index directly.
2021-09-06 14:01:24 +04:30
Ali Mohammad Pur
97e97bccab
Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safe
2021-09-06 01:53:26 +02:00
sin-ack
8ea22121ac
Userland: Migrate to argument-less deferred_invoke
...
Only one place used this argument and it was to hold on to a strong ref
for the object. Since we already do that now, there's no need to keep
this argument around since this can be easily captured.
This commit contains no changes.
2021-09-02 03:47:47 +04:30
thankyouverycool
96dee93d3f
FontEditor: Adjust margins and spacing
...
Brings vertical spacing in line with most other apps using
ToolbarContainers. Fixes GroupBox margins since CSS ordering
change.
2021-08-27 12:38:29 +02:00
thankyouverycool
e8e7c59c34
FontEditor: Let WindowServer manage modified markings
...
Simplifies building modified/new font titles and lets FontEditor
make use of the comfy ellipsis close button.
2021-08-27 12:38:29 +02:00
thankyouverycool
a621932c11
FontEditor: Save discrete undo and redo states for each Command
...
Makes undo/redo actions compatible with the updated UndoStack sans
finalization. Fixes having to click actions twice.
2021-08-27 12:38:29 +02:00