| Commit message (Collapse) | Author | Age | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this patch, pt-or-px values, like letter-spacing, were *always*
scaled using the current DPI value.
This is wrong; if the fonts are scaled using the output’s scaling
factor, then so should all other point values.
This also fixes an issue where e.g. letter-spacing would use one DPI
value at startup, but then when increasing/decreasing or resetting the
font size, would be re-calculated using a different DPI value, leading
to completely different spacing.
This happened when there were multiple monitors, with different DPI
values, and foot guessed the initial DPI value wrong. Normally, foot
would correct itself as soon as the window was mapped, and the
“correct” DPI value known. But if the fonts were scaled using the
scaling factor, it was possible that the font reload never happened.
This patch also updates the thickness calculation (for LIGHT and HEAVY
box drawing characters) to use the scaling factor when appropriate.
Closes #680
|
| |
|
|
|
|
|
|
|
|
| |
../../box-drawing.c: In function 'box_drawing':
../../box-drawing.c:2774:13: error: 'y1' may be used uninitialized in this function [-Werror=maybe-uninitialized]
2774 | int y0, y1;
| ^~
../../box-drawing.c:2774:9: error: 'y0' may be used uninitialized in this function [-Werror=maybe-uninitialized]
2774 | int y0, y1;
| ^~
|
| |
|
|
|
| |
Improve the visual quality of sextants (and wedges) when the cell height isn’t a
multiple of three.
|
| |
|
|
|
| |
In several cases, this expanded to multiple calls, and when inlined, resulted in
much larger code size.
|
| |
|
|
| |
This reduces the number of loads in the rest of the function.
|
| |
|
|
|
| |
Re-use the pre-calculated offsets used by the sextants. This is the correct
thing to do since wedges *should* align with sextants.
|
| |
|
|
|
|
|
|
| |
We’re using floating point math, as a way to ensure that sextant primitives
overlap, rather than leaving empty spaces, or being uneven, when the cell
width/height isn’t divisible with 2 (width) or 3 (height).
This gets rid of all floating point math from the sextant drawing functions.
|
| |
|
|
|
|
| |
That is, encode which “pieces” make up each quad in a static array, and use a
single function to draw all quads using the four primitives “upper left/right,
lower left/right”.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
We render the inverted wedges by first rendering a non-inverted triangle, and
then inverting it with PIXMAN_OP_OUT.
In cases where truncating and round():ing the triangle points have different
results, the final, inverted wedge ends up being unaligned with the
corresponding sixel(s).
This patch fixes that by handling the pre-inverted triangles
specifically. I.e. we don’t re-use the same triangle coordinates as the
corresponding non-inverted triangle.
|
| |
|
|
|
| |
Since they’re not exactly alike, we still need branches within each case. Better
to split them up - one case per codepoint.
|
| |
|
|
|
|
| |
These are the “wedges” from the Unicode 13 “Legacy Computing” symbols.
Closes #474
|
| | |
|
| | |
|
| |
|
|
|
| |
This way, the compiler doesn’t have to waste instructions on
re-ordering the parameters
|
| |
|
|
|
| |
It results in quite a lot of floating point instructions being emitted
in almost every box drawing function we have...
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
When enabled, shades are rendered as solid blocks, using a darker
variant of the current foreground color.
When disabled, shades are instead rendered in a checker box pattern,
using the foreground color unmodified.
Default is enabled.
|
| |
|
|
|
| |
This causes relevant box drawing characters (diagonals, arcs etc) to
be antialiased as well.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When drawing on an a8 buffer, apply antialiasing to LIGHT ARCs. This
is done by supersampling; draw to a 4 times bigger buffer, then
downsample, where each downsampled pixel is the average of the
corresponding 4x4 pixel from the supersampled buffer.
We also need to take supersampling into account while adjusting the row
and col when pixel aligning the arcs with the regular
horizontal/vertical lines.
The shape of the ARCs can still be improved. Still, this is a much
needed improvement over the current implementation.
Closes #279
|
| | |
|
| | |
|
| |
|
|
|
| |
For now, switching is done using a static variable. In the future,
this could be a user option.
|
| |
|
|
|
|
| |
We don’t have a method to draw the arcs using pixman yet. Work around
this by replacing the a8 buffer with an a1 buffer, and render the arcs
using our old, non-antialiased, way.
|
| |
|
|
|
| |
The DARK shade is the one most dense, and thus the one that looks
brightest.
|
| |
|
|
|
|
|
|
| |
When rendering to an a8 surface, render shades using “transparent”
pixman rectangles.
When these glyphs are composited with a color, the resulting look is
the color, but darkened.
|
| | |
|
| |
|
|
| |
Use trapezoids to rasterize the diagonal lines.
|
| |
|
|
| |
Use pixman_image_fill_rectangles() to render rectangles. Duh!
|
| |
|
|
|
|
|
|
| |
Use pixman_image_fill_rectangles() to render horizontal and vertical
lines.
Despite the name, this *is* the appropriate function to use, since our
lines *do* have a thickness, and thus *are* rectangles.
|
| |
|
|
| |
The inner corner, where the upper/left lines meet, were missing
|
| | |
|
| |
|
|
| |
Part of #471
|
| | |
|
| |
|
|
|
| |
Both are functionally equivalent here, but the former is also properly
scoped, can be naturally indented and has a less repetitive syntax.
|
| |
|
|
| |
Cell size is defined as the length of the diagonal of the cell.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
If the value is specified without a unit, then the value is assumed to
be in points, subject to DPI scaling.
The value can optionally have a ‘px’ suffix, in which case the value
is treated as a raw pixel count.
|
| |
|
|
|
| |
Box drawing characters should always cover the entire cell. No more,
no less.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
“The optimize attribute should be used for debugging purposes
only. It is not suitable in production code.”
Luckily, it seems it really isn’t needed anymore; with all the other
size optimizations that has been done since this was introduced, there
is no longer any difference with or without this pragma.
|
| | |
|
| |
|
|
|
|
| |
Mixed here refers to mixed thickness - the lines thickness doesn’t
match the thickness of an abstract, orthogonal line going through the
middle of the cell.
|
| |
|
|
|
|
|
|
|
|
|
| |
When mirroring an arc, we need to adjust the mirrored position if the
arc’s position in the cell is asymmetrical. This happens when *either*
the line is odd sized, *or* the cell is. But not when both are.
Thus, we can simply do a ‘thickness % 2 ^ width % 2’ when adjusting
the position.
Describe this in a comment.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
This greatly reduces the size of the foot binary
|
| |
|
|
| |
While this doesn’t really reduce foot’s size, it is cleaner
|
| |
|
|
|
|
|
|
|
| |
This reduces the size of the foot binary by ~4K; all the quad
macros called ceil() and floor() twice per macro, which caused many
float -> int -> float conversions in the expanded code.
By using functions instead, there’s no expansion - the conversion only
happens in one (well, four) places.
|
| |
|
|
|
|
|
|
|
| |
We were using so many function arguments that a lot of the emitted
code was just stack push and pops to pass around arguments.
Bundle the buffer data, width, height, stride, and current DPI, into a
single ‘buf’ argument. This greatly reduces the number of arguments to
all functions.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
* U+2571
* U+2572
* U+2573
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
Also combine the HORIZONTAL versions into a single draw function.
* U+2506
* U+2507
* U+250A
* U+250B
* U+254E
* U+254F
|
| |
|
|
|
|
|
|
|
| |
*U+2504
*U+2505
*U+2508
*U+2509
*U+254C
*U+254D
|
| | |
|
| | |
|
| |
|
|
| |
At least in odd-sized cells, with a thickness of 1 pixel.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
Rename the *function* {h,v}line() to _{h,v}line(), and add two new
macros: hline() and vline().
This allows us to shorten the argument list by removing the ‘buf’ and
‘stride’ arguments.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
thickness() is a static function and thus ‘const’ is not necessary.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
* U+2591
* U+2592
* U+2593
|
| |
|
|
|
| |
If the cell width/height is odd, the previous implementation would
result in uneven quads.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* U+2596
* U+2597
* U+2598
* U+2599
* U+259A
* U+259B
* U+259C
* U+259D
* U+259E
* U+259F
|
| |
|
|
|
|
| |
* U+2590
* U+2594
* U+2595
|
| |
|
|
|
| |
This is especially important for the LEFT xxx BLOCK characters, since
cells can be quite narrow, and one eighth is not a lot...
|
| | |
|
| |
|
|
|
|
|
| |
* U+257C
* U+257D
* U+257E
* U+257F
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
* U+2574
* U+2575
* U+2576
* U+2577
* U+2578
* U+2579
* U+257A
* U+257B
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* U+253D
* U+253E
* U+253F
* U+2540
* U+2541
* U+2542
* U+2542
* U+2543
* U+2544
* U+2545
* U+2546
* U+2547
* U+2548
* U+2549
* U+254A
|
| |
|
|
|
|
|
|
|
| |
* U+2535
* U+2536
* U+2537
* U+2538
* U+2539
* U+253A
|
| |
|
|
|
|
|
|
|
| |
* U+252d
* U+252e
* U+252f
* U+2530
* U+2531
* U+2532
|
| |
|
|
|
|
|
|
|
| |
* U+2525
* U+2526
* U+2527
* U+2528
* U+2529
* U+252A
|
| |
|
|
|
|
|
|
|
| |
* U+251D
* U+251E
* U+251F
* U+2520
* U+2521
* U+2522
|
| |
|
|
|
|
|
|
|
|
|
| |
* U+250D
* U+250E
* U+2511
* U+2512
* U+2515
* U+2516
* U+2519
* U+251A
|
| |
|
|
|
| |
All solid lines LIGHT/HEAVY line drawings implemented so far can be
implemented in terms of these.
|
| | |
|
| | |
|