summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2023-03-04Userland: Use Font::pixel_size_rounded_up() instead of glyph_height()Andreas Kling
The only remaining clients of this API are specific to bitmap fonts and editing thereof.
2023-03-04LibGfx: Add Font::pixel_size_rounded_up()Andreas Kling
This returns the font's size (distance between ascender and descender) in pixels, rounded up to the nearest integer. This is the number we want to use in a lot of UI code, so let's have a friendly API for it instead of ceil'ing the pixel_size() in a million random places.
2023-03-04LibGUI: Paint the GroupBox title with left alignmentAndreas Kling
This fixes an issue where the title would shift around at the subpixel level when appended to. (Only matters for vector fonts.)
2023-03-03LibWeb: Make Window.screen a replaceable attributeLuke Wilde
Required by Shadertoy.
2023-03-03LibGUI: Compute syntax-highlighted visual text spans using float rectsTimothy Flynn
For vector fonts in particular, we need to take care to compute offsets using floating point math. For example, with Berkeley Mono at font size 16, with syntax highlighting enabled, we are currently truncating these offsets to integers. This results in a leftward-drift when we paint the text. This changes the rect in which we paint syntax-highlighted text spans to a float rect. As we traverse the spans, we now no longer truncate any of the text offsets, and we draw the text in the correct positions. This is likely not a complete solution. TextEditor blindly casts ints to floats all over, and we will want to make all of these (hundred+) float- aware. But this should be a step in the right direction and makes vector fonts immediately more comfortable to use.
2023-03-03LibWeb: Add some folding regions to HTML syntax highlighterSam Atkins
This adds the regions generated from embedded CSS and JS, and also for HTML block comments. The glaring omission is that we don't add them for start/end tags. HTML allows start and end tags to not always match up, and I believe that's going to require some variation on the adoption-agency algorithm to make it work correctly.
2023-03-03LibSyntax: Expose folding regions from ProxyHighlighterClientSam Atkins
2023-03-03LibWeb: Add folding regions to CSS syntax highlighterSam Atkins
2023-03-03LibCpp: Add folding regions to syntax highlightersSam Atkins
This just looks at {} blocks. Unfortunately the two highlighters work differently enough that the code has to be duplicated.
2023-03-03LibGUI: Add folding regions to INI syntax highlighterSam Atkins
This lets you fold sections into a single line. We attempt to keep 1 blank line after the folded section if possible.
2023-03-03AK+readelf: Issue error when using ARCH(arch) with nonexistent archDan Klishch
This disallows erroneous `#if ARCH(x86_64)` (note lowercase x).
2023-03-03LibWeb/WebIDL: Store SimpleException message as a String{,View} variantLinus Groh
2023-03-03LibWeb/Fetch: Store Response error message as a String{,View} variantLinus Groh
The majority of error strings are StringView literals, and it seems silly to require heap-allocating strings for these. This idea is stolen from a recent change in fd1fbad :^)
2023-03-03TerminalSettings: Move scrollback settings from "Terminal" to "View"Andreas Kling
The scrollback is really a property of the view, not the terminal.
2023-03-03TerminalSettings: Spruce up the "Terminal" tab a bitAndreas Kling
- Use sentence style capitalization for CheckBox and GroupBox titles - Remove excessive explanation of bell mode. - Put a "lines" label after the scrollback history length input instead of saying "(Lines)" in the GroupBox title. - Tweak bell mode titles to make them self explanatory. - Tweak language for exit confirmation.
2023-03-03TerminalSettings: Spruce up the "View" tab a bitAndreas Kling
- Use sentence style capitalization for CheckBox and GroupBox titles. - Move the terminal font to the top. - Split the cursor settings into two GroupBoxes (one for the shape, and one for the blinking behavior).
2023-03-03TerminalSettings: Adjust layoutsAndreas Kling
Remove assymmetric vertical padding in various places.
2023-03-03TerminalSettings: Change tab orderAndreas Kling
Let's put the "View" tab first, since the most common reason to open TerminalSettings is to adjust something about the appearance.
2023-03-03LibGfx: Draw checkbox check in the center of the checkbox rectAndreas Kling
This looks better at larger checkbox sizes than just drawing it in the top left corner. Ideally we'd have a scalable checkmark, of course.
2023-03-03LibGUI: Make CheckBox height adapt to the current font sizeAndreas Kling
2023-03-03LibGUI: Make RadioButton height adapt to the current font sizeAndreas Kling
2023-03-03LibGUI: Round up font sizes in various widget size calculationsAndreas Kling
2023-03-03HackStudio: Don't hard-code a default code fontAndreas Kling
If no HackStudio specific code font is set, we fall back to the system default fixed-width font.
2023-03-03LibCore+LibGUI+About: Use String in Core::Version and GUI::AboutDialogAndreas Kling
The Core::Version API now returns ErrorOr<String>, and the GUI::AboutDialog API was adjusted to accommodate this.
2023-03-03LibWeb/Fetch: Propagate OOM errors from HeaderList::extract_mime_type()Linus Groh
2023-03-03LibWeb/MimeSniff: Port MimeType to new StringLinus Groh
2023-03-03LibWeb/MimeSniff: Rename MimeType::from_string() to MimeType::parse()Linus Groh
This matches the spec's "parse a MIME type".
2023-03-03LibWeb/XHR: Fix blob type in XMLHttpRequest::response()Linus Groh
The type attribute of a blob is supposed to be a complete mime type of the form "type/subtype", not just the determined mime type's type.
2023-03-03LibWeb/Fetch: Port infrastructure to new StringLinus Groh
2023-03-03LibWeb/Fetch: Port JS interfaces to new StringLinus Groh
Since BodyInit and Headers are tightly coupled to both Request and Response, I chose to do all of them at once instead of introducing a bunch of temporary conversion glue code.
2023-03-03LibWeb: Update generated code in Bindings/FetchMethod.cppLinus Groh
Also update the incomplete and slightly incorrect dummy interface code snippet I used to generate this.
2023-03-03LibIDL: Use OrderedHash{Table,Map} to store Enumeration valuesLinus Groh
Seems nice to keep these in the same order as the input and have deterministic codegen of interfaces in LibWeb (for the purpose of diffing two build revisions, for example).
2023-03-02LibGfx: Handle multi-code point emoji widths when drawing text runsTimothy Flynn
This API is used by LibWeb's text painter. Bring it up to date with the glyph width computations performed in draw_text_line() used by other GUI applications.
2023-03-02LibGfx: Handle multi-code point emoji when computing scaled glyph widthTimothy Flynn
2023-03-02LibPDF: Detect CFF encodings with supplementsRodrigo Tobar
These are not yet actually parsed, but detecting them means we at least don't fail to understand the *actual* format value, which was causing some CFF fonts to fail to load.
2023-03-02LibPDF: Increase argument stack for Type1FontProgramsRodrigo Tobar
Type1 imposes a stack limit of 24 elements, but Type2 has a limit of 48. We are better off relaxing the limit of the former in favour of properly supporting the latter.
2023-03-02LibPDF: Improve Type2 hint countingRodrigo Tobar
There were two issues with how we counted hints with Type2 CharString commands: the first was that we assumed a single hint per command, even though there are commands that accept multiple hints thanks to taking a variable number of operands; and secondly, the hintmask/ctrlmask commands can also take operands (i.e., hints) themselves in certain situations. This commit fixes these two issues by correctly counting hints in both cases. This in turn fixes cases when there were more than 8 hints in total, therefore a hintmask/ctrlmask command needed to read more than one byte past the operator itself.
2023-03-02LibPDF: Don't crash when a font hasn't been loaded yetRodrigo Tobar
This could happen because there was a problem while loading the first font in the document.
2023-03-02LibPDF: Prevent crashes when loading XObject streamsRodrigo Tobar
These streams might need a Filter that isn't implemented yet, and thus cannot be blindly MUST()-ed.
2023-03-02LibPDF: Improve error support for Filter classRodrigo Tobar
The Filter class had a few TODO()s that resulted in crashes at runtime. Since we now have a better way to report errors back to the user let's use that instead.
2023-03-02LibGfx+LibWeb: Propagate OOM when appending CanvasGradient color stopsMacDue
2023-03-02LibGfx+LibWeb: Propagate OOM when creating PaintStylesMacDue
2023-03-01Kernel: Move TYPEDEF_* TTY macros to API/ttydefaults.h fileLiav A
This allows us to get rid of an include to LibC/sys/ttydefaults.h in the Kernel TTY implementation. Also, move ttydefchars static const struct to another file called Kernel/API/ttydefaultschars.h, so it could be used too in the Kernel TTY implementation without the need to include anything from LibC.
2023-03-01Kernel+LibC: Move the FD_SETSIZE declaration to API/POSIX/select.h fileLiav A
2023-03-01LibWeb: Port URL and URLSearchParams to new StringKenneth Myhra
2023-03-01LibWeb: Store all members of WebIDL::ExceptionOr<T> in a single VariantTimothy Flynn
This reduces the size of WebIDL::ExceptionOr<T> as follows for a few different Ts: WebIDL::ExceptionOr<void>: 48 bytes to 40 bytes WebIDL::ExceptionOr<JS::Value>: 48 bytes to 40 bytes WebIDL::ExceptionOr<String>: 56 bytes to 40 bytes
2023-03-01LibJS: Use a Variant instead of two Optionals for ThrowCompletionOrLinus Groh
Comes with the usual benefit of saving some space on the stack, as well as making a situation where both or neither Optionals hold a value impossible. The various unwrapping additions are required as we can no longer construct a ThrowCompletionOr<T> from an Optional<T> - rightfully so.
2023-03-01LibJS: Make string_to_number() return double instead of Optional<Value>Linus Groh
This would never return an empty optional or non-numeric value, and in fact every caller as_double()'d the value right away. Let's make the type match reality instead :^)
2023-03-01LibGfx+LibUnicode: Support specifying the path to search for emojiTimothy Flynn
Similar to the FontDatabase, this will be needed for Ladybird to find emoji images. We now generate just the file name of emoji image in LibUnicode, and look for that file in the specified path (defaulting to /res/emoji) at runtime.
2023-03-01LibWeb: Delete entire grapheme clusters on backspace/delete key pressesTimothy Flynn