summaryrefslogtreecommitdiff
path: root/Userland/Libraries
AgeCommit message (Collapse)Author
2023-01-06LibPDF: Support null destination parametersRodrigo Tobar
Destination arrays contain a page number, a mode name, and parameters specific to that mode. In many cases these parameters can be set to "null", which our code wasn't taking into consideration. This commit parses these parameters taking into account whether they are null or actual numbers, and stores them as Optional<float> instead of plain floats. The parameters are not yet used anywhere else other than when formatting a Destination object, so the change is fairly small.
2023-01-06LibPDF: Fix Destination formattingRodrigo Tobar
This was not correctly written, and thus printed confusing output.
2023-01-06LibGfx: Prefer largest image with best depth for ICO displaySimon Danner
Some favicons contain multiple icons of the same size, but with increasing depth. Use the largest one to make things look nicer.
2023-01-06LibCards+Games: Make `CardGame::add_stack()` fallibleSam Atkins
And while we're at it, handle the CardStack allocation (and failure thereof) internally.
2023-01-06LibCards: Support "previewing" cards that may be covered by other cardsTimothy Flynn
For example, in Solitaire, the vertical normal stacks cover the suit of all but the topmost card in the stack. To see the suit of covered cards the user currently has to move the cards on top of them out of the way. This adds an API for games to set a card at a location to be previewed, which will draw that card on top of all other cards without moving it.
2023-01-06FileSystemAccessServer: Use `Core::Stream`Lucas CHOLLET
This patch also updates corresponding functions from `LibFileSystemAccessServerClient`. From the FileSystemAccessClient point of view, it only makes the server take `Core::Stream::OpenMode` instead of `Core::OpenMode`. So, `enum` conversions only happen within deprecated functions and not in the new `Core::Stream` friendly API. On the server side, it just removes two usages of `Core::File::open()`.
2023-01-06LibIPC: Add `File(Core::Stream::File& file, ...)`Lucas CHOLLET
2023-01-06LibCore: Add `Stream::File::leak_fd(Badge<IPC::File>)`Lucas CHOLLET
2023-01-06LibGUI: Simplify GUI::Label preferred height calculationAndreas Kling
No need to use a TextLayout here, we can just count the number of lines and multiply that by the font's preferred line height. In addition to being much simpler, it also fixes a bug where labels were got too tall if we calculated their preferred height before assigning a final width to them.
2023-01-06LibWeb: Use default system fonts for `serif`, `sans-serif`, etc.Andreas Kling
2023-01-06LibGfx: Make text painting better at aligning vector fonts verticallyAndreas Kling
This is achieved by simplifying the logic in TextLayout. We get rid of all the various ways that the layout bounding rect can get cropped. Then we make sure to use the right pixel metrics. Finally we use the font's own line gap metrics instead of hard-coding 4. The end result is that text painted with vector fonts now gets pretty reasonable vertical alignment in most cases.
2023-01-06LibGfx: Make BitmapFont's line gap be Gfx::Painter::LINE_SPACINGAndreas Kling
This is the closest thing we have to the OpenType line gap metrics. Using it here will allow us to unify more of the text painting logic.
2023-01-06LibGfx: Round menu font size up when calculating menubar heightAndreas Kling
2023-01-06LibGUI: Tweak GUI::Label auto-sizing logic for floating point font sizesAndreas Kling
We have to ceil the font size or we risk being 1px too small.
2023-01-06LibGfx: Use Gfx::Rect::align_within() to simplify text drawing logicAndreas Kling
Instead of doing this manually, just use the helper we already have.
2023-01-06LibGfx: Slim down Gfx::TextLayout API by removing unused accessorsAndreas Kling
Also store the Font as a const reference instead of a raw pointer, since we don't allow a null Font here.
2023-01-06LibGfx: Make ScaledFont::glyph_height() return the pixel heightAndreas Kling
This was returning the point height which didn't match BitmapFont and led to bogus line heights in GUI::TextEditor.
2023-01-06LibGfx: Remove unused Font::point_size()Andreas Kling
2023-01-06LibGfx: Make Font::preferred_line_height() more correctAndreas Kling
Return a float, and fix a bogus calculation of ascender + descender.
2023-01-06LibGfx: Remove bogus rounding in FontPixelMetrics::line_spacing()Andreas Kling
2023-01-06LibGfx/OpenType: Use typographic metrics when asked to by the OS/2 tableAndreas Kling
2023-01-06LibVT: Simplify TerminalWidget::widget_size_for_font()Andreas Kling
Reuse the base size calculation from compute_base_size() instead of duplicating it.
2023-01-06LibVT: Use font pixel height (pixel_size) when calculating line heightsAndreas Kling
2023-01-06LibVT: Compute the font metrics once and cache themAndreas Kling
The height of a line or column doesn't change unless the font changes, and we were already caching the line height. This patch extends it so we also cache the column width.
2023-01-06LibVT: Fix bug where terminal size got lost on font size changeAndreas Kling
When changing the font size, we now resize the terminal widget *before* setting the font. This ensures that we keep the same logical terminal size after the font change.
2023-01-06LibCards+Solitaire: Elevate card highlight management to the card stackTimothy Flynn
Instead of indicating which individual cards should be highlighted, card games now indicate which stack is highlighted. This lets the stack draw empty stacks with a highlight (e.g. the Foundation stack in Solitaire). If the stack is non-empty, the stack can delegate highlighting to the top-most card.
2023-01-06LibCards: Draw the inside of card highlight rects with rounded cornersTimothy Flynn
Currently, the outside of the card highlight has rounded corners, but the inside has square corners. It looks a bit more polished if they are both rounded.
2023-01-06LibWeb: Consider percent and fixed widths in table column distributionAliaksandr Kalenik
Change column distribution to take in account is_length() and is_percentage() width values instead of treating all cells like they have auto width by implementing it in the way described in CSS Tables 3 spec: https://www.w3.org/TR/css-tables-3/#width-distribution-algorithm distribute_width_to_column() is structured to follow schema: w3.org/TR/css-tables-3/images/CSS-Tables-Column-Width-Assignment.svg
2023-01-06LibWeb: Use available space to resolve table cells widthAliaksandr Kalenik
It is not possible to use width of containing block to resolve cells width because by the time compute_table_measures() is called row width is not known yet.
2023-01-06LibJS: Rename ToIntegerThrowOnInfinity to ToIntegerWithTruncationBodilessSleeper
This commit ticks away two of the boxes in #15525 Temporal commits: tc39/proposal-temporal@f274678 and tc39/proposal-temporal@a63a0fb
2023-01-06LibJS: Replace "is not zero" language in Temporal commentsBodilessSleeper
This commit ticks away one of the boxes in #15525 Temporal commit: tc39/proposal-temporal@9cd448a
2023-01-05LibJS: Add and begin using a completion-compatible string builderTimothy Flynn
ThrowableStringBuilder is a thin wrapper around StringBuilder to map results from the try_* methods to a throw completion. This will let us try to throw on OOM conditions rather than just blowing up.
2023-01-05LibWeb: Pass FloatRect to Painter::draw_text in fill_textVayuDev
Don't round float values to int values in CanvasRenderingContext2D::fill_text when passing them to Painter::draw_text. This also fixes a fixme.
2023-01-05LibWeb: Return floats from color stop resolution functionsMacDue
These don't deal with pixels so should not return CSSPixels. This removes one suspicious looking cast.
2023-01-05LibJS: Convert calendar operation results to floatsBodilessSleeper
This commit ticks away one of the boxes in #15525 Temporal commit: tc39/proposal-temporal@11aad40
2023-01-05LibWeb: Use CSS Pixels for viewport rectsSam Atkins
2023-01-05LibWeb: Resolve Lengths to CSSPixelsSam Atkins
2023-01-05LibWeb: Replace all px Length creation with Length::make_px(CSSPixels)Sam Atkins
2023-01-05LibWeb: Convert AbstractImageStyleValue to new pixel unitsSam Atkins
2023-01-05LibWeb+Browser+WebContent: Convert BoxModelMetrics to new pixel unitsSam Atkins
2023-01-05LibWeb: Convert Layout::Node to new pixel unitsSam Atkins
2023-01-05LibWeb: Convert Layout Boxes to new pixel unitsSam Atkins
2023-01-05LibWeb: Convert LayoutState to new pixel unitsSam Atkins
2023-01-05LibWeb: Convert InlineLevelIterator/LineBox/LineBuilder to new px unitsSam Atkins
2023-01-05LibWeb: Convert TableFormattingContext to new pixel unitsSam Atkins
2023-01-05LibWeb: Convert SVGFormattingContext to new pixel unitsSam Atkins
This is a tiny change but I'm doing it now for the sake of completeness.
2023-01-05LibWeb: Convert InlineFormattingContext to new pixel unitsSam Atkins
2023-01-05LibWeb: Convert GridFormattingContext to new pixel unitsSam Atkins
2023-01-05LibWeb: Convert FlexFormattingContext to new pixel unitsSam Atkins
2023-01-05LibWeb: Convert BlockFormattingContext to new pixel unitsSam Atkins