Commit Graph

83 Commits

Author SHA1 Message Date
Marek Roszko e8e407dfba It's not impossible for the font face to fail loading
LoadFont()'s only usage already checked for nullptr to fallback, let's actually return nullptr on a failed load

Fixes sentry KICAD-8Z
Make the cause of sentry KICAD-95
2023-02-13 20:09:05 -05:00
Seth Hillbrand bcc1e28bab Fix Windows build error
bc Microsoft owns all the words
2023-01-25 16:45:04 -08:00
Seth Hillbrand 33bef16376 Simplify the winding calculation
This algorithm is more robust against points and cheaper to execute.
2023-01-25 13:13:38 -08:00
Seth Hillbrand cf52bfcc55 Handle missing Bold/Ital outline fonts
If the font face doesn't include a Bold or Italic version, we still want
to display the font as bold/italic, so we fake it with freetype.

This also prevents recurring error messages where the outline font warns
about "substitutes" within the same font family.

Also allows variants on the weight descriptor to be used without
throwing a substitution warning

Fixes https://gitlab.com/kicad/code/kicad/issues/13654
2023-01-25 13:13:38 -08:00
Marek Roszko 0ff32d20cd wxS more things 2023-01-22 09:41:42 -05:00
Marek Roszko ac94995f70 Some more wxS 2023-01-16 19:07:50 -05:00
Jeff Young aeb0d1d887 Use a more reliable conversion to UTF8.
Fixes https://gitlab.com/kicad/code/kicad/issues/12722

Fixes https://gitlab.com/kicad/code/kicad/issues/13313
2023-01-07 13:13:13 +00:00
Jeff Young 6d73d9a08e Split another couple of hairs in the never-ending "how big is a font".
Fixes https://gitlab.com/kicad/code/kicad/issues/13009

Fixes https://gitlab.com/kicad/code/kicad/issues/13115
2022-12-12 17:37:17 +00:00
Jeff Young 740e193871 Increase bounding box of stroke text and the leader box of all text.
Fixes https://gitlab.com/kicad/code/kicad/issues/13009
2022-11-27 15:27:30 +00:00
Jeff Young 387f1214f0 Add some heuristics to guess a better font overbar offset.
Fixes https://gitlab.com/kicad/code/kicad/issues/13010
2022-11-26 17:26:20 +00:00
Ian McInerney 1683e552f7 Add/fix some variable initializations 2022-09-25 00:48:38 +01:00
dsa-t bd8b737c44 GAL: Do better job at reserving vertices. 2022-09-14 16:07:47 +00:00
jean-pierre charras bde2d388f1 Fix a very serious memory leak in OUTLINE_FONT::getTextAsGlyphs(). 2022-09-13 17:55:12 +02:00
Jeff Young 9188838e50 RIP EDA_RECT. 2022-08-31 23:57:24 +01:00
Jeff Young 560dc7d2b6 Underline for hypertext rollovers. 2022-08-27 23:58:13 +01:00
Seth Hillbrand 7a8b188569 Fix Sentry crash for font loads
We cache newstroke loading, but if we have threaded loads, we might ask
multiple threads to load the newstroke font at the same time.  This
causes conflicts in the vector allocations->crashes
2022-08-23 09:51:20 -07:00
jean-pierre charras 32551cf1ea minor coding style fix. 2022-07-31 18:35:37 +02:00
jean-pierre charras 993c446fdf Fix some warnings detected by PVS-STUDIO (most are not used vars) 2022-07-25 18:23:52 +02:00
jean-pierre charras 9f38fa43cd Fix some minor compil and Coverity warnings. 2022-06-05 11:44:49 +02:00
Jeff Young 38e5faf21b Overhaul bitmap text for performance.
Also adjusts metrics to better match stroke font.

Also removes text-halo highlighting as it's too expensive to re-render
when the zoom changes.

Fixes https://gitlab.com/kicad/code/kicad/issues/11460
2022-05-14 20:09:54 +01:00
Jeff Young 47e002a33d Add font to status bar for text objects. 2022-04-26 18:52:53 +01:00
Jeff Young 662c1ce88f Improve outline font overbar metrics. 2022-04-26 12:52:29 +01:00
Jeff Young 9b6a10fa6a Fix mirrored overbars.
Also fixes a bug that we'd render too many glyphs when some glyphs
were combined.  (To test, render "text" in Apple Chancery.  The opening
"te" is combined into a ligature after which we render an extra 't' at
the end.

Fixes https://gitlab.com/kicad/code/kicad/issues/11441
2022-04-23 14:21:12 +01:00
Jeff Young fb1e1aec9a Add tab processing for outline fonts. 2022-04-20 12:00:19 +01:00
Jeff Young 37a2ee7d03 Replace tab processing that got lost in move to new font engine.
Fixes https://gitlab.com/kicad/code/kicad/issues/11123
2022-04-20 00:06:34 +01:00
Jeff Young 659e61355c Adjust text spacing a bit more so 6.0 boards are more likely to pass DRC. 2022-03-30 16:32:24 +01:00
Jeff Young 4424865577 Make sure spaces at start of line get accounted for.
Fixes https://gitlab.com/kicad/code/kicad/issues/11276
2022-03-30 16:32:23 +01:00
Jeff Young 6a3c5b6e0e Adjust bottom- and centre-aligned linespacing to better match 6.0.
Fixes https://gitlab.com/kicad/code/kicad/issues/11269
2022-03-29 19:31:02 +01:00
Ola Rinta-Koski 6196f2bdf0 Version info: report all font libraries 2022-03-07 14:01:37 +00:00
Jeff Young 98f4b1d16c Make gcc (or linux?) happy. 2022-02-26 22:56:10 +00:00
Jeff Young 941d7f94ad Use safer UTF8 conversion routines to prevent crashes.
Fixes https://gitlab.com/kicad/code/kicad/issues/10982
2022-02-26 19:03:00 +00:00
Jeff Young d1b8b68c68 No need to partition font glyph triangulation. 2022-02-15 19:19:02 +00:00
Ola Rinta-Koski 44c93e48e9 Markup parser fix: subscript/superscript/overbar handling 2022-02-08 18:50:53 +00:00
Jeff Young 5ce559176d Overhaul the font metrics calcs for overbar, italics and bboxes. 2022-02-07 17:36:40 +00:00
jean-pierre charras 2485648a54 Fix typo in a copy/paste and a minor compil warning 2022-02-07 17:32:19 +01:00
jean-pierre charras bc710e3d97 Rework on commit 6a9607bto fix non printable char codes 2022-02-07 12:37:36 +01:00
jean-pierre charras a37a7aa1d5 move a misplaced include 2022-02-07 08:22:43 +01:00
jean-pierre charras b042e8cc41 outline_decomposer.cpp: fix a typo from commit 0a5ddb8
stroke_font.cpp better fix for commit 6a9607b
2022-02-06 18:09:30 +01:00
jean-pierre charras 6a9607b76f Fix crash when trying to draw a text with non printable chars.
Fixes #10772
https://gitlab.com/kicad/code/kicad/issues/10772
2022-02-06 08:34:19 +01:00
Marek Roszko 0a5ddb8d40 Add some vector reservations 2022-02-05 21:12:29 -05:00
Marek Roszko 41f54349a5 Replace inserts/push_backs with emplace in some spots 2022-02-05 19:53:31 -05:00
Marek Roszko 18eda73f60 Initialize m_face in constructor PVS V730 2022-02-05 11:36:02 -05:00
Jeff Young 7dadc9d2f0 Fix text bounding boxes. 2022-02-03 23:07:41 +00:00
Jeff Young b9eb3e9b05 Be more explicit about string conversions. 2022-02-03 23:07:41 +00:00
Jeff Young 5739505aa3 TextBoxes for PCBNew. 2022-01-31 20:00:47 +00:00
Roberto Fernandez Bautista 8393e02524 text boxes: remember to add the original newline characters back in!
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10665
2022-01-30 14:35:55 +00:00
Roberto Fernandez Bautista 6cf170c2c9 Text boxes: Return full word even if it doesn't fit in the column width
It does mean that the text now can be outside the text box, but this is
better than an infinite loop.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/10668
2022-01-30 14:35:55 +00:00
Marek Roszko 7ec326c003 Fix compilation error 2022-01-28 20:19:42 -05:00
Jeff Young c6a8100d46 Schematic and symbol text boxes.
Also fixes some plot bugs with arcs.

Also moves polygonization of arcs (when required) in plotting code
from 5 degrees to calculated based on ARC_HIGH_DEF.

Fixes https://gitlab.com/kicad/code/kicad/issues/5017
2022-01-28 21:38:15 +00:00
jean-pierre charras f651e31965 Fix minor compil and Coverity warnings. 2022-01-25 12:52:13 +01:00