Commit Graph

16 Commits

Author SHA1 Message Date
patrick96
3a27e891d2 fix(renderer): Drop strings with invalid UTF8 2023-05-10 17:06:00 +02:00
patrick96
71c65447f8 Move utf8 conversion code to string utils 2023-05-10 17:06:00 +02:00
patrick96
6e716296ff Formatting 2023-05-10 17:06:00 +02:00
patrick96
8ddf9d2cdf Stop using unique_ptr for on_exit 2022-03-06 18:28:26 +01:00
Patrick Ziegler
62da14e30d
Use @ for doxygen commands (#2597) 2022-02-20 21:40:48 +01:00
Patrick Ziegler
c2f087225c
Eventloop cleanup (#2577)
* eventloop: Use eventloop namespace in cpp files

* changelog: Add missing deprecated hook message

* Make eventloop and ipc classes non-copyable and non-movable

* Remove functional.hpp

* eventloop: Don't close handles in error cases

Client should be responsible for closing handles.

* eventloop: Address invalidation of handle references
2022-01-22 22:00:26 +01:00
patrick96
5be532c51b refactor(font): More robust font size calculation
Originally the size function returned the scaled `size` property for
scalable fonts and the non-scaled `pixelsize` property for non-scalable
fonts. This caused lots of issues when that property was 0 (empty bars,
characters not drawn without warning, see references at the bottom).
This behavior was mostly observed on debian where `size` is set to 0 if
`pixelsize` is set.

We now try to use both properties for both types, but prefering `size`
for scalable fonts and `pixelsize` for non-scalable ones.

This behavior doesn't break existing correct behavior but now never
returns 0. It will always try to fall back to the other property or to
some fallback value if both properties are 0.

I originally thought this could also make font patterns more expressive
by being able to specify the size of scalable fonts directly in pixels
like so:

  Unifont:size=0:pixelsize=20

or to scale non-scalable fonts by forcing polybar to fall back to the
`size` property (which is always scaled):

  Wuncon Siji:pixelsize=0:size=20

But how these two patterns are matched by `fc-match` depends both on the
font and on the distro/fontconfig setup.

Ref #706
Ref #1450
Ref #1257
2019-06-03 00:49:48 +02:00
patrick96
6ca4f06785 doc: Convert @ to \ doxygen commands
Ref #1377
2018-11-04 19:28:27 -08:00
patrick96
01f4957485 fix(font): Check FcNameParse return value
If FcNameParse returns NULL FcDefaultSubstitute segfaults

We log and throw an error here because the signal emitter swallows all
exceptions so if that exception was thrown, the bar would stop rendering
without any indication as to why.

Fixes #1435
2018-10-31 17:13:57 -07:00
Benno Fünfstück
3de914abca feat(render): support pseudo-transparency
This adds pseudo-transparency for the background of the bar and the
background of the systray.
2018-10-04 15:52:03 +02:00
Michael Carlberg
14fb86ec70 refactor(cairo): Less greedy glyph matching
Only match glyphs for consecutive characters when
the default/preferred font is being tested.

Refs #374
2017-01-25 12:03:06 +01:00
Chase Geigle
e7dc6b8bbb fix(renderer): Use proper font scaling based on DPI
This tries to mimic the old renderer's behavior as closely as possible.
In the absence of any information, DPI is assumed to be 96x96. DPI can
be configured on a per-bar basis using the configuration key "dpi".

To use the DPI configuration from Xresources (if built with support),
one can specify the following in the bar config:

dpi = ${xrdb:Xft.dpi:96}
2017-01-25 04:35:35 +01:00
Michael Carlberg
1a5246e940 refactor(cairo): Use shared_ptr for font list 2017-01-24 11:50:26 +01:00
Michael Carlberg
8b9461e63e wip(refactor): Cairo drawing 2017-01-24 07:41:46 +01:00
Michael Carlberg
a59e115622 wip(refactor): Cairo drawing 2017-01-24 07:11:14 +01:00
Michael Carlberg
5e1886a312 wip(refactor): Cairo drawing 2017-01-24 07:11:14 +01:00