summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGfx/BitmapFont.h
AgeCommit message (Collapse)Author
2021-11-11Everywhere: Pass AK::StringView by valueAndreas Kling
2021-11-10AK+Everywhere: Stop including Vector.h from StringView.hAndreas Kling
Preparation for using Error.h from Vector.h. This required moving some things out of line.
2021-09-24LibGfx: Make BitmapFont::variant() report a complete typefacethankyouverycool
2021-09-24LibGfx: Support italic BitmapFontsthankyouverycool
BitmapFont header now contains a slope byte. Slope is used to indicate slant style and is mapped in LibGfx/FontStyleMapping.h
2021-09-19LibGfx: Extend Unicode support for BitmapFontsthankyouverycool
Removes the concept of Type enumeration in favor of a bitmask which represents 544 potential byte ranges of 256 characters per bit, supporting the current unicode code point set (0x0000-0x10FFFF). Range positions are indexed in a vector for code point lookup and conversion. Co-authored-by: Lynn <lynn@foldr.moe>
2021-08-29LibGfx: Return 0 width for non-printable ASCII characterssin-ack
Non-printable characters should always have a width of 0. This is not true for some characters like tab, but those can be exempted as the need arises. Doing this here saves us from a bunch of checks in any place that needs to figure out glyph widths for text which can contain non-printable characters.
2021-07-20LibTTF+LibGfx: Make Gfx::Font::bold_variant() work for TTF fontsAndreas Kling
There's no need for this to be a virtual, it's just a font database lookup and can be done in the Font base class.
2021-07-09LibGfx: Add "override" declarations and use east const in BitmapFont.hMax Wipfli
2021-07-07LibGfx: BitmapFont: Handle '\r' and '\n' when calculating text widthLuK1337
Previously calculating multiline text width would return invalid value, this change makes it so that we are returning the longest line width. We are now also reusing same width() implementation for both UTF-8 and UTF-32 strings.
2021-06-14LibGfx: Inline BitmapFont::glyph_or_emoji_width() for fixed-width fontsAndreas Kling
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-18LibGfx: Report font glyph presence based on glyph's specific widthIdan Horowitz
This uses the per glyph width to determine if the glyph is actually present in the font, and not just inside the range the font can covers This means that characters that are in the font's range but that are missing a glyph will show up as the missing character glyph instead of being invisible.
2021-04-18FontEditor+LibGfx: Allow user to specify if a specific glyph is presentIdan Horowitz
This replaces the glyph width spinbox in the font editor with a checkbox when editing fixed width fonts that indicates if the currently selected character's glyph is present in the edited font (For variable width fonts a non zero width implies presence) This commit also changes the background color of glyphs in the glyph map based on the presence of each specific glyph in the font.
2021-04-18LibGfx: Use size_t instead of int for glyph countIdan Horowitz
The count is always non-negative
2021-04-18LibGfx: Add support for fonts that include the Hebrew Unicode BlockIdan Horowitz
2021-04-17LibGfx: Switch a bunch of API's from taking StringView to StringAndreas Kling
These were all getting converted into String internally anyway.
2021-04-11LibGfx: Add a count to FontTypes and a helper to return type namesthankyouverycool
2021-04-09LibGfx: Added dirty and raw cyrillic support for bitmap fonts.Dmitrii Trifonov
This is a very quick and diry hack to implement support for cyrillic bitmap fonts.
2021-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED) Since all of these checks are done in release builds as well, let's rename them to VERIFY to prevent confusion, as everyone is used to assertions being compiled out in release. We can introduce a new ASSERT macro that is specifically for debug checks, but I'm doing this wholesale conversion first since we've accumulated thousands of these already, and it's not immediately obvious which ones are suitable for ASSERT.
2021-02-15LibGfx: draw_glyph_or_emoji fix check for available glyphStephan Unverwerth
This would cause question marks to be rendered when a ttf with fewer glyphs than the value of the code_point was used.
2021-02-15LibGfx: Insert pixel and ttf fonts into Typeface structureStephan Unverwerth
This adds a new structure 'Typeface' to the FontDatabase that represents all fonts of the same family and variant. It can contain a list of BitmapFonts with varying size but of the same family and weight or a pointer to a single TTF font for all sizes of this Typeface.
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling