Commit Graph

56 Commits

Author SHA1 Message Date
David Capello 5c4daff128 Add options to stroke/fill text (fix #5271)
build-auto / build-auto (Debug, macos-latest) (push) Has been cancelled Details
build-auto / build-auto (Debug, ubuntu-latest) (push) Has been cancelled Details
build-auto / build-auto (Debug, windows-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, macos-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, ubuntu-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, windows-latest) (push) Has been cancelled Details
build / build (Debug, macos-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, macos-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, noscripts, cli) (push) Has been cancelled Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Has been cancelled Details
2025-07-14 23:17:25 -03:00
David Capello 8a8ddbc630 Improve performance loading list of fonts using an app::Task
We list the fonts in a background thread to fill the list of fonts in
the UI. And now we are inserting the fonts in alphabetical order.
2025-04-18 19:56:56 -03:00
David Capello b3f4e37b69 Add option to switch font hinting (fix #4931, aseprite/laf#138) 2025-04-11 17:26:03 -03:00
David Capello 816be744ac Add Widget::textBaseline() to fix several misalignments using scalable fonts
* Each widget can customize its text baseline (onGetTextBaseline()) to
  know where to draw text when it's vertically aligned to the middle
  (now more correctly "aligned to the baseline").
* Add PAINT_BASELINE to test where the baseline is on each widget.
* "Aseprite" and "Aseprite Mini" fonts now have a special
  descent/ascent configuration with a specific baseline position.
2025-03-27 18:22:51 -03:00
David Capello c949f4a5a6 Centralize defined fonts in new app::Fonts class 2025-03-04 13:54:15 -03:00
David Capello 2706d2d75a Move font related types to src/app/fonts 2025-03-03 22:36:11 -03:00
David Capello 09538f9a1a clang-format all files 2024-12-16 14:52:19 -03:00
David Capello ad57997482 Fix font preview/thumbnail in dark mode/any theme (fix #3851) 2024-11-21 19:00:57 -03:00
David Capello ff993f1687 Paint pinned fonts correctly when multiple windows option is off (fix #4815) 2024-11-21 18:11:01 -03:00
David Capello 6093282ac3 Add pin/unpin icon to font search field (#4617, #4692)
With this we can finally easily save font presets, even references to
external .ttf files.
2024-10-29 09:48:23 -03:00
David Capello 4c06fbdaf3 Improve font search/selection from the context bar (#4692)
Improves the way we can write text to search a font, use up/down keys
to navigate through the font list, and use Enter/Esc keys to select
the font and go back to the text box.
2024-10-22 14:51:23 -03:00
David Capello 5c7a3a41f6 Add ligatures button to Text tool (#4679)
Doesn't fully fix the issue as we cannot move the cursor between the
ligature clusters, but at least we can disable the ligatures now.
2024-09-25 16:37:41 -03:00
David Capello e700cce987 Merge branch 'main' into beta 2024-09-23 15:03:11 -03:00
Christian Kaiser 5860269358
Use new list_files, parse dates to check if sessions are old (#4660) 2024-09-19 15:50:02 -03:00
David Capello 0bf9353a02 Add new Text tool (fix #28)
This is the first (not yet production-ready) version of the
interactive Text tool. The text input is done with a transparent
ui::Entry, and on each text modification an ExtraCel is rendered with
this same ui::Entry's TextBlob to be displayed in the canvas with the
active zoom level.

The ui::Entry is being painted along the text in the canvas (just for
testing), but this is something to be fixed. Probably it will not be
the case in the future and a fully customized rendering (onPaint())
process will be required.
2024-08-26 11:47:57 -03:00
David Capello bc63d2f660 Fix bug ignoring bold/italic after we click another font name
If we clicked bold/italic, and then chose another font family, we were
using the cached typeface inside the FontInfo instead of an update
typeface with the selected styles applied (bold/italic).

Now we don't cache the typeface inside FontInfo to avoid this.
2024-08-26 11:47:57 -03:00
David Capello 53f045a369 Add Bold/Italic buttons to select a font 2024-08-26 11:47:57 -03:00
David Capello 455a67111a Use the most regular/normal typeface style for preview purposes 2024-08-26 11:47:57 -03:00
David Capello cf514f0c53 New font selector (fix #4363)
This new font selector list installed fonts with its proper name. It
still needs some extra work to select font set styles (regular, bold,
italic, etc.)
2024-08-26 11:47:57 -03:00
David Capello 571b4ec9f2 Update to new laf API (os::System::instance()/make()) 2024-03-05 18:50:24 -03:00
Joshua Ogunyinka bf88fa2bd1 Add missing language strings when loading/saving components 2022-10-12 14:21:21 -03:00
David Capello 7e76d81fcc Merge branch 'main' into beta 2022-02-18 19:32:33 -03:00
David Capello 2d3de1728c Add SkinTheme::get() to avoid using SkinTheme::instance() as much as possible
This was done to avoid some nullptr references using
SkinTheme::instance() (mainly from
StatusBar::IndicatorsGeneration::add()) when the application is being
closed because an exception was thrown. This might be useful to detect
certain kind of crashes from Sentry.
2022-02-18 19:01:46 -03:00
David Capello c42c5e1453 Backport new laf API to main branch of aseprite
Some features from the beta branch of aseprite & laf were backported
to the main branch of aseprite.

Related commits:
- New memory handling (db4504e816)
- New get event with timeout (e6ec13cc31)
- Convert os::NativeCursor to an enum (06a5b4f3ae)
- Adapt code to the new os::Display -> os::Window refactor (5d31314cdb)
- Save/load main window layout correctly and limit to current workarea (d6acb9e20f)
- Redraw window immediately on "live resizing" (d0b39ebade)
2021-07-05 17:51:29 -03:00
David Capello bcd69495ce Fix several issues locating windows with multiple UI windows
We've refactored the code to support locating windows (and popups
windows + hot regions) correctly in both modes: with one ui::Display
and with multiple ui::Displays.

For this we've added a new ui::fit_bounds() function that works in
both modes.
2021-03-19 18:57:56 -03:00
David Capello 35bb3af6e2 Replace all base::Bind() with lambda functions 2021-03-05 20:09:42 -03:00
David Capello db4504e816 Refactor laf-os memory handling 2020-07-07 19:06:48 -03:00
David Capello 8a3f32b47f Replace all base::Bind() with lambda functions 2020-07-03 21:51:46 -03:00
David Capello b41f1ace30 Move function to convert doc::Image -> os::Surface to app/util 2020-06-09 19:56:25 -03:00
David Capello b628e21e76 Replace MIN/MAX() macros with std::min/max() functions 2020-04-08 12:20:53 -03:00
David Capello 5cb2d984f0 Rename she -> os 2018-08-09 12:58:43 -03:00
David Capello f2ed45e795 Replace base::UniquePtr -> std::unique_ptr 2018-08-08 17:27:26 -03:00
David Capello e025d1a40a Improve widget class generator including only required .h files
Instead of including "ui/ui.h" we can include the specific header file
for the used widgets in the .xml widget.
2018-06-08 15:52:10 -03:00
David Capello dee6ff6c7e Refactor: Use new base::paths type for list of filenames/extensions 2018-02-21 11:06:58 -03:00
David Capello b6cf0f218c Add search field on Font Popup
Added support to set child visibility property to ListBox items.
2017-03-15 14:24:42 -03:00
David Capello 76485d1e8a Add more font extensions 2017-03-15 11:41:10 -03:00
David Capello 867ab891bf Add way to mix spritesheet+truetype fonts 2017-02-24 17:56:57 -03:00
David Capello ce6c85996e Update laf library (base/path is gone, use base/fs) 2016-11-01 19:14:05 -03:00
David Capello 4119962ee6 Remove Widget::onDisable/onDeselect() member functions
Replaced with an argument in onEnable/onSelect().
2016-09-08 15:53:10 -03:00
David Capello 5ecc356a41 Replace GPL license with the new EULA 2016-08-29 13:08:21 -03:00
David Capello d467d71fa5 Rename PopupWindow enums 2015-12-05 15:56:32 -03:00
David Capello e944ce0052 Move Bind, Connection, Signal, Slot, etc. to base namespace 2015-12-04 15:17:42 -03:00
David Capello 1aaeacc460 Refactor several "getNoun()" getters to "noun()"
This is a work-in-progress to create a consistent API and finally
separate the whole Aseprite base/gfx/ui libs into a reusable C++ library.

Classes:
app::IFileItem, app::AppMenuItem, app::skin::SkinPart,
gfx::Rect, gfx::Border, she::FileDialog,
ui::IButtonIcon, ui::Graphics, ui::Overlay, ui::Widget,
ui::ScrollableViewDelegate, and UI events
2015-12-04 14:39:04 -03:00
David Capello cdd955441a Rename PreferredSize -> SizeHint 2015-12-03 21:50:05 -03:00
David Capello 78ba213471 Rename ui::Widget::getChildren() -> children()
Extra changes:
* Removed UI_FOREACH_WIDGET(), replaced with range-based for-loops
2015-12-03 19:46:13 -03:00
David Capello 3b0bf6daaa Add anti-aliasing checkbox in "Edit > Insert Text" option 2015-12-01 15:46:21 -03:00
David Capello ac5d3c7e36 Cache font previews in FontPopup 2015-11-04 12:17:30 -03:00
David Capello 76bbb53c15 Fix warning about unused local variable 2015-10-29 16:18:51 -03:00
David Capello 3d76639141 Add support to load system fonts on Ubuntu in PasteTextCommand 2015-10-19 16:41:14 -03:00
David Capello 62a16d0525 Improve font selection with keyboard in PasteTextCommand 2015-10-19 15:32:44 -03:00