Commit Graph

221 Commits

Author SHA1 Message Date
Jeff Young e332320108 Handle font when reading render cache.
(Also fixes a bug where the cache's triangulation wasn't
cached.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17666
2024-05-21 11:31:35 +01:00
Seth Hillbrand 72eee002aa Add effective display for fields 2024-05-07 17:59:13 -07:00
Seth Hillbrand c8375c151c Launch default URI handler if exists
Otherwise, handle as a normal file

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17902
2024-05-06 12:22:40 -07:00
Jeff Young c59ed0bbb7 Flip symbol editor's Y axis to match other editors. 2024-04-27 13:47:56 +01:00
Jeff Young fc572bfbc6 Make sure users don't run into min text size.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17543
2024-03-23 15:50:45 +00:00
Jeff Young d08e0e9eaa _() -> _HKI() for group names. 2024-02-28 17:50:51 +00:00
Jeff Young aef87b9796 Push thickness handling down into EDA_TEXT::SetBold().
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17077

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14875
2024-02-25 17:28:52 +00:00
Jeff Young e7abeb3c38 Cleanup. 2024-02-24 20:05:51 +00:00
Jeff Young 8efd90e6e8 Allow reading of 0 text sizes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16902
2024-02-07 16:46:42 +00:00
Marek Roszko 740c7a73a2 Add missing color prop for text 2024-02-05 01:09:42 -05:00
Jeff Young a5ee614ae8 Comments. 2024-01-24 14:51:41 +00:00
Jeff Young 65b89116e1 Clean up formatting. 2024-01-18 16:17:46 +00:00
Jon Evans 7470ec80e4 Fix some issues with Font property
Prevent out-of-bounds access
Make sure list is initialized in symbol editor frame
Don't re-init the list more frequently than necessary

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16399
2023-12-22 18:34:48 -05:00
Jon Evans 786a4ce675 Use explicit booleans for schematic format 2023-11-29 16:17:41 +00:00
Jeff Young 67d8b13b02 And Font to properties manager for EDA_TEXT items.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16004
2023-11-01 00:39:42 +00:00
Seth Hillbrand d99641be40 ADDED: Git integration support
Adds support for project-based git integration, branch support, commit,
revert and updates

Fixes https://gitlab.com/kicad/code/kicad/issues/10441
2023-10-20 12:51:47 +00:00
Jeff Young f2c0f4c87f Fix logic screw-up in earlier commit. 2023-10-03 20:53:52 +01:00
Jeff Young 6fbbf981f0 Handle justification when hit-testing fields.
This steals the algo used in SCH_PAINTER to get the right coords
for the text.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15722
2023-10-03 14:36:13 +01:00
Jeff Young 0310973e3f Push TEXT_SPIN_STYLE from SCH_TEXT out to SCH_LABEL_BASE.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15444
2023-09-07 17:42:51 +01:00
Jeff Young 7b71e55ab9 Don't allow updates to shown_text outside of cacheShownText().
But also don't use cacheShownText() in c'tors, as it will not call
the subclass's version.
2023-08-07 23:22:09 +01:00
Jeff Young 5e112ca78e ADDED: parameterize font metrics and allow customization of overbar height. 2023-08-06 20:57:41 +01:00
Jeff Young eedf319ba4 Don't double-offset effective text shapes.
Also fixes several bugs with intersheet ref fields.  (It's possible for
other fields to have an ID of 0.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15165
2023-07-10 19:32:00 +01:00
Jeff Young 782c73300b Move drawing sheet datastructures to EDA_IU_SCALE.
Or mostly, at least.  Plotters still define their own mils-to-iu scale.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14934
2023-06-12 22:34:25 +01:00
Jeff Young 5875f89531 Centralize text size clamping.
Also introduces alg::clamp to improve readability of
std::max( min, std::max( value, max ) )

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14876
2023-06-03 20:29:51 +01:00
Jeff Young 570978fa7f Replace larger text bboxes now that we're not using them for knockouts. 2023-05-28 18:17:24 +01:00
Jeff Young c71cf21e2f Use rendered text to generate bounding box for knockout text.
Don't open-code knockout text shape generation in several different
places.

Make sure triangulated knockout text gets clearance added when
specified.

Collapse duplicated footprint text item plot routine (they're no
longer any different from plotting pcb text items).
2023-05-28 17:20:11 +01:00
Jeff Young dacf0b2b96 Account for changes to mimic 6.0 text positioning in bounding boxes.
This is only a partial fix as knockout text is still busted....
2023-05-27 23:41:43 +01:00
Jeff Young 95a09f686b Revert attempt to use drawing code to generate text bounding boxes. 2023-05-27 22:11:34 +01:00
Jeff Young f35a88ce0b Cache LIB_PIN text extents for performance.
Also fixes a bug where we didn't triangulate at all when the char
count didn't warrant the likely overhead of spinning up a
thread_pool.

And fix another bug where EDA_TEXT::GetRenderCache() wasn't using
the given font.

Also reverts using the cache for drawing-sheet text.  The text
items are created from scratch from the data items each time
they're drawn, so there's never an existing cache to make use of.
Instead, we now check that the item is in the view, using a very
approximate bounding box generator (because even generating a
real bounding box shows up large in profiles).

And, lastly, fixes a bug where EndPos was never considered in
DS_DATA_ITEM::IsInsidePage().

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14822
2023-05-27 16:32:11 +01:00
Jeff Young 4ed267394a Outline font performance improvements.
1) Don't fracture font glyphs when generating them; we're going
   to fracture during triangulation anyway.
2) Don't check for self-intersection when deciding to fracture.
   It costs nearly as much as the fracture does.
3) Cache drawing sheet text.
4) Use the current font when checking for cache validity.
5) Parallelize glyph triangulation.
6) Don't invalidate bounding box caches when offset by {0,0}
7) Use the glyph cache when generating text effective shape.
8) Short-circuit NormalizeJustification() if its center/center.
9) Don't triangulate for GuessSelectionCandidates()
10) Avoid sqrt whenever possible.
11) Pre-allocate bezier and SHAPE_LINE_CHAIN buffers.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14303
2023-05-27 01:35:40 +01:00
Jeff Young 768fbf5af2 Give up on trying to calculate text bounding boxes.
It results in too many hacks strewn through the code.  Just draw the
text and measure it.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14803
2023-05-26 18:44:33 +01:00
Jeff Young b41d446f58 Fix a bunch more issues with sheetpaths and allowExtraText.
A sheetpath is required to correctly resolve text variables.
Depending on currentSheet is rife with bugs.

There are many places where we do *not* want to be prepending
field names to the field values, such as netlisting,
building PDF hypertext menus, etc.

Also, Find/Replace needs to work on unresolved text, as
that's what we're going to display (and if replace nuked
your variable references you wouldn't be happy).
2023-05-05 17:23:52 +01:00
Jeff Young 7e5fedef6a Markup fixes.
1) allow escape sequences inside markup sequences
2) keep overbar when inside nested markup
3) always place overbar at full height, not sub/superscript height

Fixes https://gitlab.com/kicad/code/kicad/issues/14553

Fixes https://gitlab.com/kicad/code/kicad/issues/13449
2023-04-17 17:56:54 +01:00
Wayne Stambaugh c3e6825d62 Add hashing to and unit tests for some low level objects. 2023-04-04 15:28:34 -04:00
Wayne Stambaugh 28776f5745 Text attributes object improvements.
* Add compare method to COLOR4D object.
* Add unit test to validate COLOR4D comparison method.
* Add missing color test in text attribute comparison method.
* Add unit test for text attribute object.
* Remove unnecessary headers from text attribute header.
* Move text attribute code into separate source file.
2023-03-29 12:53:45 -04:00
Jeff Young 23accffc6d Add Property Inspector support for dimension objects.
Includes changing the class hierarchy so that dimension objects inherit
from PCB_TEXT rather than containing a PCB_TEXT member variable.
2023-03-04 23:16:46 +00:00
Jon Evans eba0783b38 Fix rotation/flipping properties for text boxes
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14159
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14164
2023-03-04 13:11:15 -05:00
Marek Roszko aacc9746e3 Yeet the last of wxSize/wxPoint to stop leaking gdicmn everywhere 2023-02-18 22:57:18 -05:00
Jeff Young 56aae7a147 Reduce compiler warnings. 2022-12-11 13:39:59 +00:00
Jon Evans 70f9d8cab9 Properties: Add text orientation 2022-12-02 21:33:21 -05:00
Jon Evans b2b3f5752f Properties: Add grouping and sorting by creation order 2022-11-27 22:40:23 -05:00
Jeff Young cef7cd8f7c Move default font to RENDER_SETTINGS.
Fixes https://gitlab.com/kicad/code/kicad/issues/12723
2022-10-22 21:32:42 +01:00
Jeff Young d16b23d16e Name shortening and line-break reduction. 2022-10-21 18:41:39 +01:00
Marek Roszko ece23d434b Split up Double2Str to a format function to make its use case clear 2022-09-17 00:10:22 -04:00
Mark Roszko b00178adb3 Nuke base_units from orbit 2022-09-16 04:38:10 +00:00
Jeff Young 6f5281258e Separate text-thickness clamping into strict and lenient modes.
We used to use the bold setting, but since PCBNew allows you to
directly define the width you end up with settings in between normal
and bold that get clamped to the normal max.

Fixes https://gitlab.com/kicad/code/kicad/issues/12367
2022-09-08 00:28:30 +01:00
Jeff Young b4492e0bd2 More EDA_RECE yeetage. 2022-08-31 17:19:50 +01:00
Jeff Young f17a865593 Move EDA_ITEM hitTest to BOX2I. 2022-08-31 17:18:45 +01:00
Jeff Young 5679b9dbdc Remove a few EDA_RECT instances. 2022-08-31 01:22:49 +01:00
Marek Roszko 8dddc07f26 Remove #ifndef that's redundant
This seems to date back to once upon a time when gerbview didn't even use base_units
2022-08-29 23:24:48 -04:00