7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-11 00:30:01 +00:00
Commit Graph

76 Commits

Author SHA1 Message Date
Jeff Young
5edae8250d Finish eradication of visibility flag on text items.
Import/read previously-hidden symbol/footprint
text items as hidden fields.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19875
2025-02-19 23:43:52 +00:00
Wayne Stambaugh
5c8f4697ca Common folder housekeeping part 1. 2025-01-12 12:06:45 -05:00
Wayne Stambaugh
89db935910 Housekeeping in include path sub-folders. 2025-01-04 09:21:11 -05:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
Dhineshkumar S
43b1bc52db Fix switching bold option on and off alters text thickness
Currently, unselecting the bold option resets the thickness to the
standard size instead of reverting to the original thickness.
To address this, the original thickness should be preserved so it
can be restored when bold is turned off.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18975
2024-11-13 02:14:19 +00:00
John Beard
7214a108e4 Text alignment: add a flip function
Reduces the need for client code to know it can exploit the
enum -1/+1 properties. ToHAlignment provides an explicit
contract for integral conversion, and also doesn't rely on the
int being exactly -1, 0 or 1 (failure to adhere to which would
be UB).
2024-10-08 23:30:50 +08:00
Jeff Young
b549c4feec Drawing sheet can't share glyph cache entries with editors.
(They use different internal units.)

Also fixes a fialure of CAIRO_GAL to reset the fill
and stroke after drawing outline glyphs.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18579
2024-08-22 12:23:21 -06:00
Seth Hillbrand
77797103f7 Add ability to embed files in various elements
Schematics, symbols, boards and footprints all get the ability to store
files inside their file structures.  File lookups now have a
kicad-embed:// URI to allow various parts of KiCad to refer to files
stored in this manner.

kicad-embed://datasheet.pdf references the file named "datasheet.pdf"
embedded in the document.  Embeds are allowed in schematics, boards,
symbols and footprints.  Currently supported embeddings are Datasheets,
3D Models and drawingsheets

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6918

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2376

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17827
2024-07-15 16:06:55 -07:00
Seth Hillbrand
11c6164934 Silence font replace warnings for libs
When loading schematics/pcbs, notification of font replacements might be
warranted but in libraries, this warning is not helpful and intrusive
2024-06-24 09:55:10 -07:00
Seth Hillbrand
bcf6b620a8 Large rework of BEZIER_POLY
Add direct handling of quadratic beziers to save compute time and number
of points.  Update cubic interpolation to reduce number of points
generated for a given smoothness

Cache data on open and used cached data to avoid multiple re-calcs

Remove minimum line length and number of segments and replace with
standard max error level.  Allows us to specify the tolerance of bezier
interpolation
2024-06-18 17:55:41 -07:00
Alex Shvartzkop
5475359d00 More build time optimizations. 2024-05-06 04:39:28 +03:00
Jon Evans
1dbe78c68b Add QA tests and expand serialization for API 2024-04-02 19:51:18 -04:00
Jeff Young
05cdd44404 Don't assume all glyphs are outline with an outline font.
Underline and overbar may be stroke glyphs.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17478
2024-03-18 22:21:01 +00:00
Jeff Young
fa0ead98d8 Split out table editing and table cell editing. 2024-02-24 20:05:51 +00:00
Jeff Young
ffa6adec96 Add a cache for TrueType contours and triangulation data.
Also returns minimumSegmentLength to its former value as
it doesn't appear to be required to fix
https://gitlab.com/kicad/code/kicad/-/issues/11463.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/16568
(cherry picked from commit 162e8962f7)
2024-02-23 16:53:29 +01:00
Jeff Young
de634c6f3e Generate tofu if we fail to decompose outline font glyph. 2024-02-05 15:49:57 +00:00
Jeff Young
a28f092b67 Don't cover STL types. 2024-02-05 15:49:57 +00:00
Jeff Young
8410a5e685 Coding conventions and cleanup. 2024-01-23 16:03:25 +00:00
Jeff Young
11805d6696 performance efficiencies 2023-12-18 17:01:55 +00:00
jean-pierre charras
6f9affe3db Fix compil warnings: disable #pragma specific to MSVC 2023-09-27 08:22:39 +02:00
Marek Roszko
4746bde4b3 gal as a shared lib, gaasl! 2023-09-26 22:31:31 -04:00
Marek Roszko
050f812f5e Move fontconfig to kicommon for now to de-duplicate the font cache 2023-09-24 22:58:18 -04:00
Marek Roszko
22b733209d Fail GAL on its header leaking audit
Maybe we should rethink directly accessing GAL so much, but at least 600 files didn't need GAL leaked into them due to view_overlay.h
2023-09-18 19:52:27 -04:00
Marek Roszko
1a6d459fb1 Fix wrong path slash 2023-09-07 22:09:26 -04:00
Marek Roszko
5da88d1d0e Move UTF8 to core 2023-09-07 20:55:16 -04:00
Jeff Young
5e112ca78e ADDED: parameterize font metrics and allow customization of overbar height. 2023-08-06 20:57:41 +01:00
Marek Roszko
3bf2fb2c0e Fix more C5266 warnings 2023-05-18 22:08:50 -04:00
Seth Hillbrand
0de24bfd59 Cleanup text alignment between version 6 and 7
Version 7 text alignment changed subtly for stroke fonts from version 6.
Additionally, the output has been different between screen and plotting,
leading to offset text in plotted output relative to the text shown on
screen.

This introduces a fudge factor in FONT::getLinePositions to correct the
offset in the plotting output relative to v6.

This also changes the SCH_PAINTER and PCB_PAINTER to correct the
relative offsets between GAL and PLOTTER classes.  The source of these
offsets is atm unclear.

Fixes https://gitlab.com/kicad/code/kicad/issues/14755
2023-05-17 13:33:49 -07:00
Seth Hillbrand
72267cf9b0 Adjust stroke font output to match v6 output
Many minor tweaks were added that changed the output of the stroke font
from v5/v6.  These offsets changed the gerber output expected.  This
reverts the changes to something much closer to the v6 output.  It is
not pixel-perfect but gets very close on most texts.

Fixes https://gitlab.com/kicad/code/kicad/issues/14609
2023-05-12 12:40:41 -07: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
b05de51a8d Fix a few Coverity issues. 2023-04-06 08:48:02 -04: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
7b3e01ce52 Select correct face from a .ttc file.
Fixes https://gitlab.com/kicad/code/kicad/issues/13314
2023-03-13 18:29:55 +00:00
Seth Hillbrand
81256c0fa4 Prevent mutex deadlock
The overbar function in outline fonts recursively calls the text
function which already owns the lock.  To avoid this, we have an
unlocked variant that is wrapped by the exposed text function

Fixes https://gitlab.com/kicad/code/kicad/issues/14015
2023-02-23 14:59:59 -08:00
Jon Evans
632f8c1df4 Fix macOS build 2023-02-22 09:19:30 -05:00
Marek Roszko
39e69a3d29 Fix up handling of font names available in multiple names
ttf fonts can declare multiple language names. Many by default opt to just declare one and not tag it any particular language.
However, there are CJK languages that typically leverage this function the most. They'll tag both a "en" and a cjk lang family name in CJK characters.

To be as user friendly as possible, we need to display said fonts in the CJK languages if KiCad to set to such a locale.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14011
2023-02-21 20:26:41 -05:00
Mark Roszko
7b4abb1f7b FT_Face is also not thread, protect getTextAsGlyphs 2023-02-17 14:39:52 +00:00
Marek Roszko
65d5b34da3 freetype is not thread safe, zone filler can trigger multi-thread access
sentry KICAD-B1

https://freetype.org/freetype2/docs/reference/ft2-base_interface.html
[Since 2.5.6] In multi-threaded applications it is easiest to use one FT_Library object per thread.
In case this is too cumbersome, a single FT_Library object across threads is possible also, as long as a mutex lock is used around FT_New_Face and FT_Done_Face.
2023-02-17 07:26:52 -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
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
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
Jeff Young
560dc7d2b6 Underline for hypertext rollovers. 2022-08-27 23:58:13 +01:00
jean-pierre charras
32551cf1ea minor coding style fix. 2022-07-31 18:35:37 +02:00
Marek Roszko
88c7322a0d EDA_TEXT Get/SetTextSize should use VECTOR2I 2022-05-14 08:16:15 -04:00
Jeff Young
47e002a33d Add font to status bar for text objects. 2022-04-26 18:52:53 +01:00
Jeff Young
b4b16e7e0f Adjust overbar height for outline fonts. 2022-04-23 22:15:39 +01:00
Jeff Young
fb1e1aec9a Add tab processing for outline fonts. 2022-04-20 12:00:19 +01:00
Jeff Young
e8a543f1ea Colors for text in PL_Editor and Eeschema.
Fixes https://gitlab.com/kicad/code/kicad/issues/1952
2022-03-31 19:43:56 +01:00
Ola Rinta-Koski
6196f2bdf0 Version info: report all font libraries 2022-03-07 14:01:37 +00:00