Commit Graph

84 Commits

Author SHA1 Message Date
abcdefg30
6a31b1f9f3 Update the copyright header year 2022-05-28 00:35:10 -05:00
Eduardo Cáceres
7eb64ea6fc Use read-only autoimplemented property when possible 2022-05-18 11:42:36 -05:00
Paul Chote
70892a6661 Change DrawSprite calls to provide scales instead of sizes.
This allows us to remove a hacky workaround for calculating
depth offsets when sprites have size.Z == 0.
2021-07-25 00:32:17 +02:00
Andre Mohren
6810469634 Updated copyright years. 2021-06-29 18:33:21 -05:00
teinarss
10676be377 Replace F extension with string interpolation 2021-05-08 22:20:59 +02:00
teinarss
3d381e6e32 Make SpriteFont.Measure take zero allocations 2021-04-03 11:22:45 +02:00
teinarss
ed295ae315 Change throw exceptions to use nameof in parameter 2021-02-28 18:43:51 +01:00
Paul Chote
67754e8693 Add alpha support to SpriteRenderer. 2021-01-06 00:06:51 +01:00
RoosterDragon
bb116034c7 Avoid or reduce LINQ allocations required in various areas. 2020-10-17 23:48:48 +02:00
Paul Chote
6cfa27c33b Replace per-color font caches with tinted rendering. 2020-08-24 18:38:08 +02:00
teinarss
19b02875c7 Use Tuple syntax 2020-08-15 10:37:10 +01:00
Paul Chote
809b1507a6 Fix font rendering at non-integer display scales. 2020-01-26 20:22:49 +01:00
Paul Chote
7611449d3d Reimplement text contrast using greyscale dilation. 2020-01-19 17:18:22 +01:00
abcdefg30
23b3c237b7 Update the year numbers in all license headers to 2020 2020-01-05 17:00:34 +00:00
teinarss
e06c97bc03 Updated the LineGraphWidget with new layout 2019-07-21 14:23:25 +02:00
teinarss
9982b01642 Get the Ascender value from mod.yaml instead from the Font 2019-06-21 12:51:45 +02:00
Ivaylo Draganov
1fee50be2e Add TruncateLabelWithTooltip helper function
* Move GetContrastColor helper to SpriteFont
* Move WidgetUtils  from OpenRA.Game.Widgets to OpenRA.Mods.Common.Widgets
2019-05-27 17:28:47 +02:00
teinarss
2d1c110857 Calculate font size correctly 2019-05-09 22:17:24 +02:00
Paul Chote
353db73381 Fix a collection of minor style violations.
This enables several new StyleCopAnalyzer rules to
be enabled immediately during migration.
2019-05-09 20:40:08 +02:00
Paul Chote
1d4576229a Move FreeType handling into the Platform dll. 2019-03-14 16:39:26 +01:00
Paul Chote
ab4a7e3558 Replace System.Drawing primitives with our own. 2019-03-04 18:26:42 +00:00
Paul Chote
094c8b6432 Use Color.ToString() in perf logs. 2019-03-04 18:26:42 +00:00
abcdefg30
cadbd0d9ab Change the year number in all cs headers from 2018 to 2019 2019-01-26 23:15:21 +01:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
RoosterDragon
a71a5cc71d Reduce the size of the sheets created for fonts.
- A 512x512 sheet is about half full after precaching and some usage, but uses 16x less memory than the default 2048x2048 sheet. This saving occurs twice as we maintain a managed buffer for this sheet.
- Only precache smaller fonts, as the larger fonts are less used and take up more space than is worthwhile.
- Only precache in white, as red is largely unused.
2017-11-19 12:40:04 +00:00
Andrii Yukhymchak
636a9a74a1 Font Crash gracious fallback 2017-11-01 18:50:15 +01:00
Paul Chote
69b4b541d2 Fix mutable use of float2 in SpriteFont. 2017-10-17 15:46:07 +02:00
Paul Chote
5e7c816257 Add support for font scaling. 2017-01-21 10:59:59 +00:00
Taryn Hill
43317e0f5d Update copyright notice year to 2017 2016-12-31 23:46:13 -06:00
Oliver Brakmann
1059d5b88d Add a Shadow option to LabelWidget and ButtonWidget 2016-09-02 20:58:46 +02:00
Oliver Brakmann
8ad18ad161 Rewrite color inversal in a reusable way 2016-09-02 20:58:46 +02:00
Paul Chote
e71225496b Clarify GPL version. 2016-02-21 16:30:48 +00:00
Paul Chote
b396965fd9 Update licence header year. 2016-02-21 16:27:31 +00:00
Paul Chote
844e1a1770 Loads fonts via the virtual filesystem. 2016-02-06 21:24:43 +00:00
RoosterDragon
b5f24c3fa6 Add some missing Dispose calls, fix some Dispose implementations. 2016-01-01 04:51:54 +00:00
RoosterDragon
b0619a3e25 Added comments in performance sensitive code. 2015-12-13 16:24:54 +00:00
Matthias Mailänder
bb6d4388df always return a default height based on font size 2015-06-13 08:36:37 +02:00
Matthias Mailänder
bac11e23f6 avoid an often forgotten NullReferenceException 2015-06-10 06:39:54 +02:00
Paul Chote
26fd858fc7 Use premultiplied alpha for all textures and blending. 2015-05-23 08:50:28 +01:00
RoosterDragon
b48b994f16 Remove half-baked thread-safety mechanisms from Sheet.
Sheet is now thread-unsafe, rather than attempting to expose a dodgy thread safety model.
2015-05-20 18:50:28 +01:00
Robert Rouhani
4987a6b24c Updated SharpFont to 3.0.0, adjusted font rendering code for new fixed-point types. 2015-04-25 10:26:41 -04:00
David Jiménez
f15f1e41e8 Made int2 struct immutable 2015-03-20 13:54:01 +01:00
RoosterDragon
c313c52e96 Avoid a globally shared SheetBuilder in SpriteFont.
A globally shared sheet builder leaks memory and resources between mod switches. Instead, we create and inject the sheet builder during mod startup to ensure we still share the builder across all fonts, but can reclaim it when the mod is unloaded.
2015-01-19 21:04:17 +00:00
RoosterDragon
930d9cbea3 Cache or inline some delegates to avoid repeated allocations. 2015-01-14 22:57:41 +00:00
abcdefg30
8ca61aa917 Updated all year numbers 2015-01-09 21:18:05 +01:00
Matthias Mailänder
bc3acfeee7 StyleCop clean OpenRA.Game 2015-01-04 15:38:54 +01:00
Hellhake
5a97a4b63b Fix StyleCop warnings in OpenRA.Game 2015-01-02 12:11:01 +01:00
RoosterDragon
9cbac2d5e1 Clean up style of files affected by the last commit. 2014-12-22 17:34:02 +00:00
RoosterDragon
a6f5a21ed4 Made Sheet.Texture into Sheet.GetTexture() since we will want to call it for side-effects.
Do the same for Sheet.Data since it has the side effect of generating a buffer.
2014-11-29 12:04:50 +00:00
Matthias Mailänder
44b485606f StyleCop 2014-11-01 16:36:51 +01:00