From: Nathan Williams Date: Tue, 18 Oct 2022 22:59:20 +0000 (-0700) Subject: Remove large gifs from GFK (#5431) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd3c5843ace2ba493184d1b33f9672154ba428e9;p=thirdparty%2Fgoogle%2Ffonts.git Remove large gifs from GFK (#5431) * Remove large GIFs from GFK. These files are too large for our pipeline. We are running into timeouts. --- diff --git a/.github/workflows/knowledge_graph.py b/.github/workflows/knowledge_graph.py index de83cff575..5bf64eb1fb 100644 --- a/.github/workflows/knowledge_graph.py +++ b/.github/workflows/knowledge_graph.py @@ -2,12 +2,16 @@ from absl import app from absl import flags import itertools import mistune # markdown => ast +from xml.dom import minidom from pathlib import Path import re import sys from typing import Callable, Iterable, List, Mapping, Set, Union +MAX_IMAGE_SIZE_KB = 800 + + def _topic_target_to_path(_: Set[str], target: str) -> str: # TODO sanity check if this is the only valid update return Path(target.replace("/topic/", "topics/")) / "topic.textproto" @@ -94,6 +98,8 @@ def _link_target_to_path(names: Mapping[str, str], target: str) -> Path: def main(_): + return_code = 0 + knowledge_dir = Path(__file__).parent.parent.parent / "cc-by-sa" / "knowledge" assert knowledge_dir.is_dir(), f"No dir {knowledge_dir}" @@ -106,7 +112,6 @@ def main(_): continue unambiguous_names[name] = str(entries[0].relative_to(knowledge_dir).parent) - return_code = 0 for md_file in md_files: ast = _markdown_ast(md_file) for link in _ast_iter(ast, lambda v: v.get("type", None) == "link"): @@ -130,6 +135,22 @@ def main(_): print(result, target, "=>", target_path) print(" in", md_file.relative_to(knowledge_dir)) + image_files = list(knowledge_dir.glob("**/images/*")) + for image_file in image_files: + if image_file.name == "thumbnail.svg": + root = minidom.parseString(image_file.read_text()).documentElement + if root.tagName != "svg": + print("Root element must be :", image_file.relative_to(knowledge_dir)) + return_code = 1 + has_view_box = "viewBox" in root.attributes + has_width_and_height = "width" in root.attributes and "height" in root.attributes + if not has_view_box and not has_width_and_height: + print("Must specify viewBox and/or width+height on :", image_file.relative_to(knowledge_dir)) + return_code = 1 + if image_file.suffix != ".svg" and image_file.stat().st_size > MAX_IMAGE_SIZE_KB * 1024: + print("File exceeds max size of %s KB:" % MAX_IMAGE_SIZE_KB, image_file.relative_to(knowledge_dir)) + return_code = 1 + sys.exit(return_code) diff --git a/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/interactive_animations_with_variable_fonts/content.md b/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/interactive_animations_with_variable_fonts/content.md index 35fd047bcf..c39fd35636 100644 --- a/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/interactive_animations_with_variable_fonts/content.md +++ b/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/interactive_animations_with_variable_fonts/content.md @@ -37,6 +37,12 @@ For more demanding situations where shifts in positioning aren’t acceptable at
+images/4_4a.gif + +
+ +
+ ![INSERT_ALT](images/4_4b.gif)
@@ -59,4 +65,10 @@ Multiplexing isn’t limited to just standard variations in weight or grades eit Finally, for other special interactive effects, keep in mind that `:hover` isn’t limited to just hyperlinks. For example, you can wrap arbitrary elements in their own `span` elements and use that for triggering hover effects. You can also tweak the timing of a transition to make it faster or slower: +
+ +images/4_6.gif + +
Multiplexed hover effects with more expressive variations, on a letter-by-letter basis.
+ Interactivity is a virtually infinite space for experience design, and variable fonts offer that much more room for exploration. For more ideas on using variable fonts, see the [other articles listed under the topic of variable fonts](https://fonts.google.com/knowledge/topics/variable_fonts). diff --git a/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/optimizing_typographic_space_with_variable_fonts/content.md b/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/optimizing_typographic_space_with_variable_fonts/content.md index 80119ada4b..5e06df7148 100644 --- a/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/optimizing_typographic_space_with_variable_fonts/content.md +++ b/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/optimizing_typographic_space_with_variable_fonts/content.md @@ -6,7 +6,7 @@ Higher-level properties like `font-size`, `width`, `padding`, and `line-height`
-![INSERT_ALT](images/3_1.gif) +images/3_1.gif
Static fonts with a layout breakpoint: A single breakpoint changes padding, font sizes, and line-height.
@@ -15,7 +15,7 @@ A smoother and more seamless approach is to reduce the reliance on such queries,
-![INSERT_ALT](images/3_2.gif) +images/3_2.gif
Static fonts with intrinsic layout: The widths of the fonts remain fixed, but padding, font sizes, and line-heights change more smoothly with relative units.
@@ -28,7 +28,7 @@ The most obvious approach for optimizing a typeface’s spatial proportions is t
-![INSERT_ALT](images/3_3.gif) +images/3_3.gif
Breakpoint for static fonts with intrinsic layout: Now the font widths also change, but only at a single breakpoint.
@@ -37,7 +37,7 @@ Static typeface families that offer multiple widths sometimes have large differe
-![INSERT_ALT](images/3_4.gif) +images/3_4.gif
Gradual variable font changes with intrinsic layout: Everything changes smoothly thanks to relative units and the fine-tuning flexibility of variable fonts.
@@ -48,7 +48,7 @@ Special care should be taken when adjusting the width of a typeface, particularl
-![INSERT_ALT](images/3_5.svg) +images/3_5.svg
Avoid extremely narrow or wide font variants for paragraph text, as they can harm readability when typesetting anything more than a few words at a time.
@@ -81,7 +81,7 @@ A technique that is much less common is to use variable fonts with an axis for a
-![INSERT_ALT](images/3_8.gif) +images/3_8.gif
Variable fonts allow for extenders that shrink or grow as space allows to prevent glyphs from colliding between lines.
diff --git a/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/optimizing_typographic_space_with_variable_fonts/images/3_1.gif b/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/optimizing_typographic_space_with_variable_fonts/images/3_1.gif deleted file mode 100644 index 8ac5d3fcf6..0000000000 Binary files a/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/optimizing_typographic_space_with_variable_fonts/images/3_1.gif and /dev/null differ diff --git a/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/optimizing_typographic_space_with_variable_fonts/images/3_2.gif b/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/optimizing_typographic_space_with_variable_fonts/images/3_2.gif deleted file mode 100644 index d29a40d7ec..0000000000 Binary files a/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/optimizing_typographic_space_with_variable_fonts/images/3_2.gif and /dev/null differ diff --git a/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/optimizing_typographic_space_with_variable_fonts/images/3_3.gif b/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/optimizing_typographic_space_with_variable_fonts/images/3_3.gif deleted file mode 100644 index 7da4b08743..0000000000 Binary files a/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/optimizing_typographic_space_with_variable_fonts/images/3_3.gif and /dev/null differ diff --git a/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/optimizing_typographic_space_with_variable_fonts/images/3_4.gif b/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/optimizing_typographic_space_with_variable_fonts/images/3_4.gif deleted file mode 100644 index 9e64d0943f..0000000000 Binary files a/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/optimizing_typographic_space_with_variable_fonts/images/3_4.gif and /dev/null differ diff --git a/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/optimizing_typographic_space_with_variable_fonts/images/3_5.svg b/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/optimizing_typographic_space_with_variable_fonts/images/3_5.svg deleted file mode 100644 index ec670e118b..0000000000 --- a/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/optimizing_typographic_space_with_variable_fonts/images/3_5.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/optimizing_typographic_space_with_variable_fonts/images/3_8.gif b/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/optimizing_typographic_space_with_variable_fonts/images/3_8.gif deleted file mode 100644 index d04db1630d..0000000000 Binary files a/cc-by-sa/knowledge/modules/using_variable_fonts_on_the_web/lessons/optimizing_typographic_space_with_variable_fonts/images/3_8.gif and /dev/null differ