diff --git a/Assets/Fonts/Inter-Bold.ttf b/Assets/Fonts/Inter-Bold.ttf new file mode 100644 index 0000000..9fb9b75 Binary files /dev/null and b/Assets/Fonts/Inter-Bold.ttf differ diff --git a/Assets/Fonts/Inter-Medium.ttf b/Assets/Fonts/Inter-Medium.ttf new file mode 100644 index 0000000..458cd06 Binary files /dev/null and b/Assets/Fonts/Inter-Medium.ttf differ diff --git a/Assets/Fonts/Inter-Regular.ttf b/Assets/Fonts/Inter-Regular.ttf new file mode 100644 index 0000000..b7aaca8 Binary files /dev/null and b/Assets/Fonts/Inter-Regular.ttf differ diff --git a/Assets/Fonts/Inter-SemiBold.ttf b/Assets/Fonts/Inter-SemiBold.ttf new file mode 100644 index 0000000..47f8ab1 Binary files /dev/null and b/Assets/Fonts/Inter-SemiBold.ttf differ diff --git a/Assets/Fonts/JetBrainsMono-Medium.ttf b/Assets/Fonts/JetBrainsMono-Medium.ttf new file mode 100644 index 0000000..9767115 Binary files /dev/null and b/Assets/Fonts/JetBrainsMono-Medium.ttf differ diff --git a/Assets/Fonts/JetBrainsMono-SemiBold.ttf b/Assets/Fonts/JetBrainsMono-SemiBold.ttf new file mode 100644 index 0000000..a70e69b Binary files /dev/null and b/Assets/Fonts/JetBrainsMono-SemiBold.ttf differ diff --git a/Assets/Fonts/OFL-Inter.txt b/Assets/Fonts/OFL-Inter.txt new file mode 100644 index 0000000..9b2ca37 --- /dev/null +++ b/Assets/Fonts/OFL-Inter.txt @@ -0,0 +1,92 @@ +Copyright (c) 2016 The Inter Project Authors (https://github.com/rsms/inter) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION AND CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/Assets/Fonts/OFL-JetBrainsMono.txt b/Assets/Fonts/OFL-JetBrainsMono.txt new file mode 100644 index 0000000..8bee414 --- /dev/null +++ b/Assets/Fonts/OFL-JetBrainsMono.txt @@ -0,0 +1,93 @@ +Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/DESIGN.md b/DESIGN.md index 1f3bbc3..a51c4ed 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -177,5 +177,5 @@ rejected in favour of the values above. - **Still to sweep:** `Themes/Controls.xaml` and the dozens of hardcoded hexes in XAML/C# still use the legacy palette. Surfaces convert one at a time; the end state is that every colour, radius and spacing value resolves from `Tokens.xaml` and a guard fails on any raw `#hex` outside it. -- Fonts (Inter, JetBrains Mono) are declared as token families with system fallbacks; the bundled - font assets land next. +- **Fonts ship with the app** (`Assets/Fonts/*.ttf`, OFL-1.1) — no installation, no network, no + dependence on what the machine happens to have. Notice and license text travel with them (`THIRD-PARTY-NOTICES.txt` items 13-14). diff --git a/THIRD-PARTY-NOTICES.txt b/THIRD-PARTY-NOTICES.txt index e1b4139..9b1274f 100644 --- a/THIRD-PARTY-NOTICES.txt +++ b/THIRD-PARTY-NOTICES.txt @@ -154,6 +154,25 @@ there on purpose. selfie_segmenter_landscape.onnx. Runs entirely on the user's PC. +13. Inter (bundled UI typeface — the DESIGN.md standard) + Copyright (c) 2016 The Inter Project Authors (https://github.com/rsms/inter) + License: SIL Open Font License 1.1 (OFL-1.1) + Home: https://rsms.me/inter/ + Source: https://github.com/rsms/inter/releases/tag/v4.1 + Assets: Assets/Fonts/Inter-Regular.ttf, Inter-Medium.ttf, Inter-SemiBold.ttf, + Inter-Bold.ttf — unmodified static instances from the v4.1 release. + The OFL text ships beside them at Assets/Fonts/OFL-Inter.txt. + Note: bundled as separate font files loaded through WPF's font stack — an + aggregate, not linked code, so the OFL and the GPL coexist here. + +14. JetBrains Mono (bundled telemetry/mono typeface — the DESIGN.md standard) + Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono) + License: SIL Open Font License 1.1 (OFL-1.1) + Home: https://www.jetbrains.com/lp/mono/ + Source: https://github.com/JetBrains/JetBrainsMono/releases/tag/v2.304 + Assets: Assets/Fonts/JetBrainsMono-Medium.ttf, JetBrainsMono-SemiBold.ttf — + unmodified; OFL text at Assets/Fonts/OFL-JetBrainsMono.txt. + -------------------------------------------------------------------------------- MISCELLANEOUS diff --git a/Themes/Tokens.xaml b/Themes/Tokens.xaml index 11d28ad..ef0f96f 100644 --- a/Themes/Tokens.xaml +++ b/Themes/Tokens.xaml @@ -44,10 +44,10 @@ - - Inter, Segoe UI - JetBrains Mono, Cascadia Mono, Consolas + + /Assets/Fonts/#Inter + /Assets/Fonts/#JetBrains Mono 32 24 diff --git a/docs/ai/product.md b/docs/ai/product.md index b89e914..d115ac2 100644 --- a/docs/ai/product.md +++ b/docs/ai/product.md @@ -98,6 +98,13 @@ the rule itself still stands for its other reasons. **NEVER:** would complicate every redistribution. The app's icon + logo (`Assets/llamacasty-icon.*`, `Assets/llamacasty-logo.jpg`) are the creator's own art — all rights reserved, outside the GPL (`ADDITIONAL-TERMS.md`). +- **Ship a font whose licence was not checked.** The two bundled families — **Inter** and + **JetBrains Mono** — are **SIL Open Font License 1.1** (approved 2026-10-30 with the DESIGN.md + standard). OFL is a free licence but is **not** GPL-compatible in the linking sense; they ship as + separate `.ttf` files loaded through WPF's font stack, which is aggregation, so the two coexist. + Obligations: keep the copyright line in `THIRD-PARTY-NOTICES.txt`, ship the `OFL-*.txt` text + beside the files in `Assets/Fonts/`, and never modify the fonts or reuse their reserved family + names for a modified version. Any new typeface needs this same check before it ships. - **Ship an ML model without clean provenance** — the background-effects model (TASK 51) is Google's official MediaPipe Selfie Segmenter download (Apache-2.0, model card), converted by our own script. Model-zoo re-hosts (e.g. PINTO #109 = ML Kit's model, extracted) are off-limits. Apache-2.0 §4 diff --git a/ytLive.Tests/BundledFontsTests.cs b/ytLive.Tests/BundledFontsTests.cs new file mode 100644 index 0000000..c1f3ee0 --- /dev/null +++ b/ytLive.Tests/BundledFontsTests.cs @@ -0,0 +1,61 @@ +using System.IO; +using System.Linq; +using Xunit; + +namespace ytLive.Tests; + +/// The DESIGN.md type standard names Inter and JetBrains Mono, and the creator ruled +/// (2026-10-30) that they ship with the app rather than depending on what the machine happens to +/// have installed. That makes them third-party assets with obligations, so this guard covers the +/// whole chain: the files are present and unmodified, the project ships them as resources, the +/// theme resolves them from the pack folder, and the OFL notice + license text travel with them. +/// +/// A missing font would otherwise fail silently — WPF falls back to a system face and the +/// design standard quietly stops being true. +public class BundledFontsTests +{ + private static readonly string[] Files = + { + "Inter-Regular.ttf", "Inter-Medium.ttf", "Inter-SemiBold.ttf", "Inter-Bold.ttf", + "JetBrainsMono-Medium.ttf", "JetBrainsMono-SemiBold.ttf", + }; + + [Fact] + public void The_standard_typefaces_ship_bundled_with_their_OFL_notice() + { + // 1. The files are there and are real font binaries, not placeholders. + foreach (var name in Files) + { + var path = SourceAssert.RepoPath("Assets", "Fonts", name); + Assert.True(new FileInfo(path).Length > 50_000, $"{name} looks like a placeholder"); + } + + // 2. The project packages them as WPF resources. + Assert.Contains(@"Assets\Fonts\*.ttf", SourceAssert.Text("ytLive.csproj")); + + // 3. The theme resolves each family from the pack folder — a bare family name would + // only work if the user happened to have the font installed. + var tokens = SourceAssert.Text("Themes", "Tokens.xaml"); + Assert.Contains("/Assets/Fonts/#Inter", tokens); + Assert.Contains("/Assets/Fonts/#JetBrains Mono", tokens); + + // 4. The OFL obligations: notice in THIRD-PARTY-NOTICES.txt, license text beside the files. + var notices = SourceAssert.Text("THIRD-PARTY-NOTICES.txt"); + Assert.Contains("Inter", notices); + Assert.Contains("JetBrains Mono", notices); + Assert.Contains("SIL Open Font License 1.1", notices); + + foreach (var ofl in new[] { "OFL-Inter.txt", "OFL-JetBrainsMono.txt" }) + { + var text = SourceAssert.Text("Assets", "Fonts", ofl); + Assert.Contains("SIL OPEN FONT LICENSE", text); + } + + // 5. No other font family sneaks in through the token sheet. + var families = SourceAssert.Text("Themes", "Tokens.xaml") + .Split('\n') + .Where(l => l.Contains("FontFamily x:Key=", System.StringComparison.Ordinal)) + .ToList(); + Assert.Equal(2, families.Count); + } +} diff --git a/ytLive.csproj b/ytLive.csproj index 43aaa48..dc00ee9 100644 --- a/ytLive.csproj +++ b/ytLive.csproj @@ -1,136 +1,138 @@ - - - - WinExe - net8.0-windows10.0.19041.0 - enable - enable - true - true - Assets\llamacasty-icon.ico - ytLive - ytLive - - x64 - - - - - - - - - - - - - $(IntermediateOutputPath)BuildStamp.g.cs - $([System.Guid]::NewGuid().ToString('N').Substring(0,8)) - $([System.DateTime]::Now.ToString('yyyy-MM-dd HH:mm:ss')) - - 17 - 13 - - - - - - $(CommitCountRaw.Trim()) - $(ProjectDir)BuildCounter.txt - $([System.IO.File]::ReadAllText('$(BuildCounterFile)').Trim()) - 423 - $([MSBuild]::Add($(PriorBuildCount), 1)) - - - - $(BuildNumberStart) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_Parameter1>ytLive.Tests - - - - - - - - - - - - - - - + + + + WinExe + net8.0-windows10.0.19041.0 + enable + enable + true + true + Assets\llamacasty-icon.ico + ytLive + ytLive + + x64 + + + + + + + + + + + + + $(IntermediateOutputPath)BuildStamp.g.cs + $([System.Guid]::NewGuid().ToString('N').Substring(0,8)) + $([System.DateTime]::Now.ToString('yyyy-MM-dd HH:mm:ss')) + + 17 + 13 + + + + + + $(CommitCountRaw.Trim()) + $(ProjectDir)BuildCounter.txt + $([System.IO.File]::ReadAllText('$(BuildCounterFile)').Trim()) + 423 + $([MSBuild]::Add($(PriorBuildCount), 1)) + + + + $(BuildNumberStart) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_Parameter1>ytLive.Tests + + + + + + + + + + + + + + +