Commit Graph

25 Commits

Author SHA1 Message Date
Andreas Kling
12a42edd13 Everywhere: codepoint => code point 2021-06-01 10:01:11 +02:00
Ali Mohammad Pur
a91a49337c LibCore+Everywhere: Move OpenMode out of IODevice
...and make it an enum class so people don't omit "OpenMode".
2021-05-12 11:00:45 +01:00
Andreas Kling
b91c49364d AK: Rename adopt() to adopt_ref()
This makes it more symmetrical with adopt_own() (which is used to
create a NonnullOwnPtr from the result of a naked new.)
2021-04-23 16:46:57 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
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-22 11:22:27 +02:00
Idan Horowitz
3c894d1e6f LibGfx: Use size_t instead of int for glyph count
The count is always non-negative
2021-04-18 22:10:25 +02:00
Andreas Kling
36f27094d0 LibTTF: Make load_from_file() take String instead of StringView 2021-04-17 01:27:30 +02:00
Nicholas-Baron
73dd293ec4 Everywhere: Add -Wdouble-promotion warning
This warning informs of float-to-double conversions. The best solution
seems to be to do math *either* in 32-bit *or* in 64-bit, and only to
cross over when absolutely necessary.
2021-04-16 19:01:54 +02:00
Andreas Kling
e0f32626bc LibGfx: Rename 32-bit BitmapFormats to BGRA8888 and BGRx888x
The previous names (RGBA32 and RGB32) were misleading since that's not
the actual byte order in memory. The new names reflect exactly how the
color values get laid out in bitmap data.
2021-03-16 11:50:03 +01:00
Andreas Kling
ef1e5db1d0 Everywhere: Remove klog(), dbg() and purge all LogStream usage :^)
Good-bye LogStream. Long live AK::Format!
2021-03-12 17:29:37 +01:00
Stephan Unverwerth
b807d51598 LibTTF: Fix glyph rasterizer coverage calculation 2021-02-28 10:01:41 +01:00
Linus Groh
e265054c12 Everywhere: Remove a bunch of redundant 'AK::' namespace prefixes
This is basically just for consistency, it's quite strange to see
multiple AK container types next to each other, some with and some
without the namespace prefix - we're 'using AK::Foo;' a lot and should
leverage that. :^)
2021-02-26 16:59:56 +01:00
Andreas Kling
5d180d1f99 Everywhere: Rename ASSERT => VERIFY
(...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-23 20:56:54 +01:00
Andreas Kling
8aec1cd232 LibTTF: ScaledFont should have a NonnullRefPtr<TTF::Font>
A ScaledFont without an underlying TTF::Font would not be valid.
2021-02-17 23:45:21 +01:00
Andreas Kling
085696ea39 LibTTF: Interpret font names from Windows platform as UTF-16BE
This turns the admittedly aesthetic "T a h o m a" into "Tahoma" :^)
2021-02-16 17:32:42 +01:00
Stephan Unverwerth
de811faf55 LibTTF: Address some minor TODOs in the font implementation 2021-02-15 08:50:48 +01:00
Stephan Unverwerth
05d31cbeeb LibTTF: Add hack for recognizing fixed-width fonts 2021-02-15 08:50:48 +01:00
Stephan Unverwerth
3b67b55c84 LibGfx: draw_glyph_or_emoji fix check for available glyph
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-15 08:50:48 +01:00
Stephan Unverwerth
85158dc0ad LibGfx+LibTTF: Allow Painter to draw TTF glyphs 2021-02-15 08:50:48 +01:00
Stephan Unverwerth
0f41f5d9ba LibGUI+LibGfx+LibTTF: Make fontpicker handle TTF fonts 2021-02-15 08:50:48 +01:00
Stephan Unverwerth
179dba652e LibGfx: Insert pixel and ttf fonts into Typeface structure
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-02-15 08:50:48 +01:00
Stephan Unverwerth
2c4e13f14a LibTTF: Parse TTF "name" table 2021-02-15 08:50:48 +01:00
Luke
3e723ec177 LibTTF: Check if the given offset plus offset table size would overflow
If it does overflow, it would think there was enough data to read in
table information, when there isn't. This would cause read buffer
overflows when reading in the table information.

Found by: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=29338&sort=-opened&can=1&q=proj%3Aserenity
2021-02-08 18:01:41 +01:00
Ben Wiederhake
67cda61b7f Libraries: Add missing headers
A C++ source file containing just
    #include <LibFoo/Bar.h>
should always compile cleanly.

This patch adds missing header inclusions that could have caused weird error
messages if they were used in a different context. Also, this confused QtCreator.
2021-01-22 21:49:54 +01:00
asynts
adbb8d62d1 Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it
easier to find potentially introduced bugs with git bisect.
2021-01-16 11:54:35 +01:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00