diff options
author | Hans Hagen <pragma@wxs.nl> | 2019-10-01 11:01:50 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2019-10-01 11:01:50 +0200 |
commit | 7b12427f475e64e06f5dd7b537462b6d990526f6 (patch) | |
tree | c8b553e26752f0900f8f50241970bb5cdefd3938 | |
parent | fd8697791360a26a2b9cc888dbc125cefedfcd42 (diff) | |
download | context-7b12427f475e64e06f5dd7b537462b6d990526f6.tar.gz |
2019-10-01 10:44:00
45 files changed, 1096 insertions, 355 deletions
diff --git a/doc/context/documents/general/qrcs/setup-cs.pdf b/doc/context/documents/general/qrcs/setup-cs.pdf Binary files differindex 20a61013b..fd324eeff 100644 --- a/doc/context/documents/general/qrcs/setup-cs.pdf +++ b/doc/context/documents/general/qrcs/setup-cs.pdf diff --git a/doc/context/documents/general/qrcs/setup-de.pdf b/doc/context/documents/general/qrcs/setup-de.pdf Binary files differindex 12f539a54..145170255 100644 --- a/doc/context/documents/general/qrcs/setup-de.pdf +++ b/doc/context/documents/general/qrcs/setup-de.pdf diff --git a/doc/context/documents/general/qrcs/setup-en.pdf b/doc/context/documents/general/qrcs/setup-en.pdf Binary files differindex f76346da3..8aeaeaf09 100644 --- a/doc/context/documents/general/qrcs/setup-en.pdf +++ b/doc/context/documents/general/qrcs/setup-en.pdf diff --git a/doc/context/documents/general/qrcs/setup-fr.pdf b/doc/context/documents/general/qrcs/setup-fr.pdf Binary files differindex 176571e80..f83384805 100644 --- a/doc/context/documents/general/qrcs/setup-fr.pdf +++ b/doc/context/documents/general/qrcs/setup-fr.pdf diff --git a/doc/context/documents/general/qrcs/setup-it.pdf b/doc/context/documents/general/qrcs/setup-it.pdf Binary files differindex ac7d33b6a..e224ba312 100644 --- a/doc/context/documents/general/qrcs/setup-it.pdf +++ b/doc/context/documents/general/qrcs/setup-it.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-cs.pdf b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf Binary files differindex e91b973d2..cba60a63a 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-cs.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-de.pdf b/doc/context/documents/general/qrcs/setup-mapping-de.pdf Binary files differindex 8dc0271b8..8b68e2cfb 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-de.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-de.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-en.pdf b/doc/context/documents/general/qrcs/setup-mapping-en.pdf Binary files differindex 1323e0a59..a0c9f0cc0 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-en.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-en.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf Binary files differindex 296fb3395..af919948f 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-it.pdf b/doc/context/documents/general/qrcs/setup-mapping-it.pdf Binary files differindex 14a763fce..a78ae6350 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-it.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-it.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf Binary files differindex 803262009..3380ec091 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf b/doc/context/documents/general/qrcs/setup-mapping-ro.pdf Binary files differindex b67a37612..7c72d1f72 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-ro.pdf diff --git a/doc/context/documents/general/qrcs/setup-nl.pdf b/doc/context/documents/general/qrcs/setup-nl.pdf Binary files differindex 05c21c685..e686f5b41 100644 --- a/doc/context/documents/general/qrcs/setup-nl.pdf +++ b/doc/context/documents/general/qrcs/setup-nl.pdf diff --git a/doc/context/documents/general/qrcs/setup-ro.pdf b/doc/context/documents/general/qrcs/setup-ro.pdf Binary files differindex 7434d5d3a..b542ba111 100644 --- a/doc/context/documents/general/qrcs/setup-ro.pdf +++ b/doc/context/documents/general/qrcs/setup-ro.pdf diff --git a/doc/context/sources/general/manuals/luametafun/luametafun-svg.tex b/doc/context/sources/general/manuals/luametafun/luametafun-svg.tex index f7aba06fd..069abc6a6 100644 --- a/doc/context/sources/general/manuals/luametafun/luametafun-svg.tex +++ b/doc/context/sources/general/manuals/luametafun/luametafun-svg.tex @@ -25,7 +25,7 @@ to \METAPOST\ operators. We took a few images from a mozilla emoji font: \getbuffer[2] \stoplinecorrection -Because we get pictures, you can do mess around with them: +Because we get pictures, you can mess around with them: \startbuffer[1] \startMPcode diff --git a/doc/context/sources/general/manuals/luametafun/mozilla-svg-001.svg b/doc/context/sources/general/manuals/luametafun/mozilla-svg-001.svg index f74af7dd1..5e46d8467 100644 --- a/doc/context/sources/general/manuals/luametafun/mozilla-svg-001.svg +++ b/doc/context/sources/general/manuals/luametafun/mozilla-svg-001.svg @@ -1 +1,72 @@ -<svg xmlns="http://www.w3.org/2000/svg"><path fill="#d87512" d="M17.786 44.63c-.606.115-1.23.173-1.854.173-2.444 0-4.644-.864-6.04-2.375-.855-.92-1.394-2.147-1.517-3.47-.126-1.243.067-2.638.58-4.163.325-1.016.83-2.01 1.365-3.064.216-.426.437-.858.65-1.302.702-1.454 1.504-3.164 2.11-5.05.715-2.188.943-4.287.682-6.23-.267-2.102-.994-3.972-1.74-5.685a2.992 2.992 0 0 0-4.15-1.446c-.71.375-1.23 1-1.467 1.77a2.983 2.983 0 0 0 .218 2.292c.632 1.19 1.314 2.596 1.592 3.977.238 1.137.18 2.41-.184 3.897-.37 1.538-.976 3.143-1.522 4.518-.16.406-.33.816-.507 1.234-.507 1.215-1.032 2.47-1.364 3.838-.55 2.14-.666 4.152-.348 5.97.36 2.163 1.41 4.14 2.955 5.567 2.027 1.88 4.808 2.914 7.826 2.914 1.14 0 2.274-.146 3.375-.437l-.66-2.923"/><g fill="#bc600d"><path d="M11.585 43.742s.387 1.248.104 3.05c0 0 2.045-.466 1.898-2.27 0 0-.815-.29-2-.78M9.19 41.484S8.98 42.94 7.93 44.43c0 0 2.103.42 2.774-1.265 0 0-.696-.66-1.515-1.68M8.398 37.21s-.926 1.432-3.23 2.322c0 0 1.514 2.303 3.53.904 0 0-.237-1.388-.3-3.226M12.964 15.833s-1.685.798-3.783 3.45c0 0 2.1 1.55 4.663 2.228 0 0 .285-3.093-.88-5.677M13.5 23.873s-2.988.544-5.57 2.794c0 0 1.615 1.708 3.583 2.62 0 0 1.678-3.39 1.987-5.414M10.32 31.73s-1.483 0-4.483.812c0 0-.01 2.873 2.94 2.823 0 0 .747-1.75 1.544-3.635"/></g><g fill="#d87512"><path d="M53.33 39.37c0-4.484-35.622-4.484-35.622 0 0 10.16.05 10.25 17.81 10.25 17.762 0 17.812-.09 17.812-10.25"/><path d="M42.645 56.04c1.688 2.02 9.275.043 10.504-2.28 5.01-9.482-.006-13.58-.006-13.58l-10.5 1.313s-2.154 11.977 0 14.547"/></g><g fill="#bc600d"><path d="M54.2 41.496s-.336 4.246-4.657 9.573c0 0 4.38-1.7 5.808-4.3 0 0 .448-3.02-1.15-5.274M55.08 48.69s-1.065 1.88-3.563 3.872c0 0 1.78-.03 2.576-.785 0 0 .77-1.41.987-3.086"/></g><path fill="#f29a2e" d="M35.484 60.38c1.87 2.23 8.547 2.09 10.574 0 2.904-2.995 2.78-16.656 2.904-23.314l-12.418-1.053s-3.444 21.52-1.06 24.367"/><g fill="#bc600d"><path d="M48.21 53.53s-3.578-3.443-8.738-.013c0 0 5.754 2.455 7.365 5.672 0 0 1.126-2.245 1.373-5.66M48.775 46.06s-3.852-3.09-7.938 1.43c0 0 4.452-.47 7.632 3.635 0 0 .493-3.05.305-5.065"/></g><g fill="#3e4347"><path d="M43.847 61.57l-.397-2.765 1.344 2.445zM40.41 61.996l.502-3.294.498 3.294zM36.713 61.3l1.317-2.26-.372 2.59z"/></g><path fill="#d87512" d="M28.388 56.04c-1.688 2.02-9.277.043-10.504-2.28-5.01-9.482.004-13.58.004-13.58l10.5 1.313s2.154 11.977 0 14.547"/><g fill="#bc600d"><path d="M16.833 41.496s.336 4.246 4.657 9.573c0 0-4.38-1.7-5.807-4.3 0 0-.448-3.02 1.15-5.274M15.957 48.69s1.066 1.88 3.563 3.872c0 0-1.782-.03-2.576-.785 0 0-.772-1.41-.987-3.086"/></g><path fill="#f29a2e" d="M35.548 60.38c-1.87 2.23-8.548 2.09-10.575 0-2.904-2.995-2.78-16.656-2.904-23.314l12.417-1.053s3.446 21.52 1.06 24.367"/><g fill="#bc600d"><path d="M22.822 53.53s3.58-3.443 8.74-.013c0 0-5.754 2.455-7.367 5.672 0 0-1.125-2.245-1.373-5.66M22.255 46.06s3.852-3.09 7.94 1.43c0 0-4.453-.47-7.633 3.635 0 0-.493-3.05-.307-5.065"/></g><g fill="#3e4347"><path d="M26.24 61.25l1.345-2.445-.395 2.765zM29.62 61.996l.5-3.294.5 3.294zM33.375 61.63L33 59.04l1.32 2.26zM35.516 60.46c-.395-2.48-.482-4.96-.5-7.438.015-2.48.104-4.96.5-7.44.396 2.48.485 4.96.5 7.44-.018 2.48-.106 4.96-.5 7.438"/></g><path fill="#f29a2e" d="M27.777 6.994c0 3.82-2.727 6.987-6.086 6.915C11.83 13.7 15.893 2 15.893 2c3.36 0 11.885 1.176 11.885 4.994"/><path fill="#af5a31" d="M24.05 7.752c0 2.037-1.454 3.727-3.248 3.688-5.26-.11-3.093-6.353-3.093-6.353 1.792 0 6.34.628 6.34 2.665"/><path fill="#f29a2e" d="M43.26 6.994c0 3.82 2.726 6.987 6.086 6.915 9.86-.21 5.8-11.91 5.8-11.91C51.782 2 43.26 3.176 43.26 6.994"/><path fill="#af5a31" d="M46.983 7.752c0 2.037 1.455 3.727 3.247 3.688 5.26-.11 3.094-6.353 3.094-6.353-1.794 0-6.34.628-6.34 2.665"/><path fill="#f29a2e" d="M55.806 33.378c0 7.155-9.517 8.13-20.288 8.13-10.776 0-20.29-.975-20.29-8.13 0-29.96 11.596-29.14 20.29-29.14 8.69 0 20.288-.82 20.288 29.14"/><g fill="#3e4347"><path d="M35.54 7.59c3.24 0 6.15 1.084 8.156 2.81-.77-2.945-4.135-5.16-8.173-5.16-4.06 0-7.442 2.238-8.186 5.204 2.01-1.753 4.938-2.855 8.204-2.855"/><path d="M35.535 11.193c2.217 0 4.21.744 5.584 1.925-.528-2.02-2.835-3.534-5.6-3.534-2.78 0-5.095 1.533-5.605 3.564 1.376-1.198 3.383-1.955 5.62-1.955"/></g><path fill="#ffe8bb" d="M29.553 43.727l-18.408-7.01 4.24-9.06s2.704 3.85 13.29 6.82l.878 9.243"/><path fill="#3e4347" d="M29.37 39.77c-7.462-1.27-16.325-6.673-16.48-6.75l.992-2.168c.184.092 8.806 5.342 15.853 6.544l-.366 2.374"/><path fill="#ffe8bb" d="M41.48 43.727l18.406-7.01-4.24-9.06s-2.704 3.85-13.29 6.82l-.876 9.243"/><path fill="#3e4347" d="M41.663 39.77c7.46-1.27 16.325-6.673 16.48-6.75l-.993-2.168c-.184.092-8.808 5.342-15.852 6.544l.365 2.374"/><g fill="#ffe8bb"><path d="M43.524 45.57C38.752 42.023 41.4 33.86 41.4 33.86c-5.657 5.906-12.662 8.74-12.662 8.74 1.608 5.446 5.77 6.412 5.77 6.412-.34-1.835.663-3.302.663-3.302 1.68 2.22 5.03 2.986 5.03 2.986-1.287-1.508-.948-3.835-.948-3.835 2.326.875 4.27.71 4.27.71"/><path d="M42.29 42.97c-2.634 2.247-10.917 2.247-13.553 0-2.856-2.435-2.495-7.144.1-9.884 2.397-2.527 10.958-2.527 13.355 0 2.595 2.74 2.956 7.45.098 9.883"/></g><g fill="#3e4347"><path d="M36.18 40.48a.69.69 0 0 1-.644-.477c-.227-.67-.77-3.293-.71-5.498.01-.398.325-.71.7-.698.38.01.674.343.663.74-.057 2.01.46 4.466.633 4.974.127.375-.06.786-.414.92a.607.607 0 0 1-.23.04"/><path d="M30.504 43.25c.21-.202.394-.408.582-.61.188-.204.378-.405.57-.604.385-.396.782-.78 1.2-1.145a14.125 14.125 0 0 1 2.745-1.9c.504-.263 1.032-.49 1.59-.654s1.153-.273 1.772-.253c.31.01.623.055.928.146.307.088.602.23.86.416.263.19.485.422.652.684.17.257.287.54.35.83a4.247 4.247 0 0 0-.677-.448 2.567 2.567 0 0 0-.68-.237c-.447-.088-.887-.04-1.33.06-.89.216-1.786.65-2.69 1.114-.905.466-1.818.983-2.776 1.466-.48.24-.97.473-1.48.682-.256.103-.517.202-.783.285-.27.078-.546.155-.833.167"/></g><path fill="#f15a61" d="M41.34 31.743c-1.17-.528-4.757-.57-5.83-.57-1.07 0-4.66.042-5.83.57-.832.376-.187 1.31 2.027 2.116 1.397.506 2.733.666 3.803.666 1.07 0 2.405-.16 3.805-.667 2.213-.808 2.856-1.74 2.025-2.117"/><g fill="#3e4347"><path d="M29.917 23.48l1.61 5.292L26.954 26z"/><path d="M22.645 31.828c-.522 0-.932-.056-1.17-.098-2.986-.52-4.632-1.996-6.09-4.067l.185-2.472c1.52 1.446 3.953 3.76 6.28 4.167 1.156.2 2.853-.016 4.15-1.234 1.537-1.44 2.263-4.05 2.1-7.547l1.635.132c.2 4.312-.116 7.244-2.212 9.212-1.692 1.59-3.613 1.908-4.878 1.908M41.12 23.48l-1.613 5.292L44.08 26z"/><path d="M48.39 31.828c.52 0 .93-.056 1.167-.098 2.99-.52 4.637-1.996 6.09-4.067l-.182-2.472c-1.52 1.446-3.955 3.76-6.28 4.167-1.156.2-2.855-.016-4.154-1.234-1.532-1.44-2.258-4.05-2.095-7.547l-1.636.132c-.202 4.312.114 7.244 2.213 9.212 1.69 1.59 3.61 1.908 4.877 1.908"/></g><path fill="#ffe8bb" d="M30.25 22.09c-.852 5.282-3.728 5.87-6.696 5.577-2.986-.294-5.396-2.667-5.396-6.743 0-4.28 0-4.28 6.647-5.752 6.728-1.49 6 3.437 5.445 6.918"/><path fill="#3e4347" d="M29.16 22.547c-.244 2.534-2.61 4.357-5.287 4.072-2.674-.286-4.645-2.57-4.402-5.102s.28-2.75 5.108-2.237c4.83.514 4.824.737 4.582 3.267"/><path fill="#fff" d="M27.59 21.884c-.16 1.688-1.74 2.903-3.522 2.714-1.785-.19-3.096-1.712-2.936-3.4.163-1.69.186-1.835 3.406-1.493 3.22.344 3.215.49 3.053 2.18"/><g fill="#3e4347"><ellipse cx="25.5" cy="21.08" rx="1.45" ry="1.647"/><path d="M31.27 17.896c.42 0 .807-.284.936-.728.16-.546-.133-1.122-.65-1.29l-5.98-1.924c-.516-.166-1.065.14-1.225.685-.155.543.136 1.12.652 1.287l5.98 1.924a.95.95 0 0 0 .288.046"/></g><path fill="#ffe8bb" d="M40.78 22.09c.855 5.282 3.73 5.87 6.7 5.577 2.984-.294 5.395-2.667 5.395-6.743 0-4.28-.002-4.28-6.646-5.752-6.73-1.49-6.01 3.437-5.45 6.918"/><path fill="#3e4347" d="M41.873 22.547c.243 2.534 2.61 4.357 5.287 4.072 2.674-.286 4.646-2.57 4.402-5.102-.242-2.533-.28-2.75-5.107-2.237-4.83.514-4.824.737-4.582 3.267"/><path fill="#fff" d="M43.44 21.884c.16 1.688 1.737 2.903 3.522 2.714 1.783-.19 3.098-1.712 2.936-3.4-.16-1.69-.188-1.835-3.404-1.493-3.22.344-3.217.49-3.054 2.18"/><g fill="#3e4347"><ellipse cx="47.722" cy="20.932" rx="1.45" ry="1.647"/><path d="M39.76 17.896a.982.982 0 0 1-.935-.728c-.16-.546.132-1.122.65-1.29l5.98-1.924c.517-.166 1.063.14 1.224.685.155.543-.136 1.12-.653 1.287l-5.98 1.924a.96.96 0 0 1-.287.046"/></g></svg> +<svg xmlns="http://www.w3.org/2000/svg"> + <path fill="#d87512" d="M17.786 44.63c-.606.115-1.23.173-1.854.173-2.444 0-4.644-.864-6.04-2.375-.855-.92-1.394-2.147-1.517-3.47-.126-1.243.067-2.638.58-4.163.325-1.016.83-2.01 1.365-3.064.216-.426.437-.858.65-1.302.702-1.454 1.504-3.164 2.11-5.05.715-2.188.943-4.287.682-6.23-.267-2.102-.994-3.972-1.74-5.685a2.992 2.992 0 0 0-4.15-1.446c-.71.375-1.23 1-1.467 1.77a2.983 2.983 0 0 0 .218 2.292c.632 1.19 1.314 2.596 1.592 3.977.238 1.137.18 2.41-.184 3.897-.37 1.538-.976 3.143-1.522 4.518-.16.406-.33.816-.507 1.234-.507 1.215-1.032 2.47-1.364 3.838-.55 2.14-.666 4.152-.348 5.97.36 2.163 1.41 4.14 2.955 5.567 2.027 1.88 4.808 2.914 7.826 2.914 1.14 0 2.274-.146 3.375-.437l-.66-2.923"/> + <g fill="#bc600d"> + <path d="M11.585 43.742s.387 1.248.104 3.05c0 0 2.045-.466 1.898-2.27 0 0-.815-.29-2-.78M9.19 41.484S8.98 42.94 7.93 44.43c0 0 2.103.42 2.774-1.265 0 0-.696-.66-1.515-1.68M8.398 37.21s-.926 1.432-3.23 2.322c0 0 1.514 2.303 3.53.904 0 0-.237-1.388-.3-3.226M12.964 15.833s-1.685.798-3.783 3.45c0 0 2.1 1.55 4.663 2.228 0 0 .285-3.093-.88-5.677M13.5 23.873s-2.988.544-5.57 2.794c0 0 1.615 1.708 3.583 2.62 0 0 1.678-3.39 1.987-5.414M10.32 31.73s-1.483 0-4.483.812c0 0-.01 2.873 2.94 2.823 0 0 .747-1.75 1.544-3.635"/> + </g> + <g fill="#d87512"> + <path d="M53.33 39.37c0-4.484-35.622-4.484-35.622 0 0 10.16.05 10.25 17.81 10.25 17.762 0 17.812-.09 17.812-10.25"/> + <path d="M42.645 56.04c1.688 2.02 9.275.043 10.504-2.28 5.01-9.482-.006-13.58-.006-13.58l-10.5 1.313s-2.154 11.977 0 14.547"/> + </g> + <g fill="#bc600d"> + <path d="M54.2 41.496s-.336 4.246-4.657 9.573c0 0 4.38-1.7 5.808-4.3 0 0 .448-3.02-1.15-5.274M55.08 48.69s-1.065 1.88-3.563 3.872c0 0 1.78-.03 2.576-.785 0 0 .77-1.41.987-3.086"/> + </g> + <path fill="#f29a2e" d="M35.484 60.38c1.87 2.23 8.547 2.09 10.574 0 2.904-2.995 2.78-16.656 2.904-23.314l-12.418-1.053s-3.444 21.52-1.06 24.367"/> + <g fill="#bc600d"> + <path d="M48.21 53.53s-3.578-3.443-8.738-.013c0 0 5.754 2.455 7.365 5.672 0 0 1.126-2.245 1.373-5.66M48.775 46.06s-3.852-3.09-7.938 1.43c0 0 4.452-.47 7.632 3.635 0 0 .493-3.05.305-5.065"/> + </g> + <g fill="#3e4347"> + <path d="M43.847 61.57l-.397-2.765 1.344 2.445zM40.41 61.996l.502-3.294.498 3.294zM36.713 61.3l1.317-2.26-.372 2.59z"/> + </g> + <path fill="#d87512" d="M28.388 56.04c-1.688 2.02-9.277.043-10.504-2.28-5.01-9.482.004-13.58.004-13.58l10.5 1.313s2.154 11.977 0 14.547"/> + <g fill="#bc600d"> + <path d="M16.833 41.496s.336 4.246 4.657 9.573c0 0-4.38-1.7-5.807-4.3 0 0-.448-3.02 1.15-5.274M15.957 48.69s1.066 1.88 3.563 3.872c0 0-1.782-.03-2.576-.785 0 0-.772-1.41-.987-3.086"/> + </g> + <path fill="#f29a2e" d="M35.548 60.38c-1.87 2.23-8.548 2.09-10.575 0-2.904-2.995-2.78-16.656-2.904-23.314l12.417-1.053s3.446 21.52 1.06 24.367"/> + <g fill="#bc600d"> + <path d="M22.822 53.53s3.58-3.443 8.74-.013c0 0-5.754 2.455-7.367 5.672 0 0-1.125-2.245-1.373-5.66M22.255 46.06s3.852-3.09 7.94 1.43c0 0-4.453-.47-7.633 3.635 0 0-.493-3.05-.307-5.065"/> + </g> + <g fill="#3e4347"> + <path d="M26.24 61.25l1.345-2.445-.395 2.765zM29.62 61.996l.5-3.294.5 3.294zM33.375 61.63L33 59.04l1.32 2.26zM35.516 60.46c-.395-2.48-.482-4.96-.5-7.438.015-2.48.104-4.96.5-7.44.396 2.48.485 4.96.5 7.44-.018 2.48-.106 4.96-.5 7.438"/> + </g> + <path fill="#f29a2e" d="M27.777 6.994c0 3.82-2.727 6.987-6.086 6.915C11.83 13.7 15.893 2 15.893 2c3.36 0 11.885 1.176 11.885 4.994"/> + <path fill="#af5a31" d="M24.05 7.752c0 2.037-1.454 3.727-3.248 3.688-5.26-.11-3.093-6.353-3.093-6.353 1.792 0 6.34.628 6.34 2.665"/> + <path fill="#f29a2e" d="M43.26 6.994c0 3.82 2.726 6.987 6.086 6.915 9.86-.21 5.8-11.91 5.8-11.91C51.782 2 43.26 3.176 43.26 6.994"/> + <path fill="#af5a31" d="M46.983 7.752c0 2.037 1.455 3.727 3.247 3.688 5.26-.11 3.094-6.353 3.094-6.353-1.794 0-6.34.628-6.34 2.665"/> + <path fill="#f29a2e" d="M55.806 33.378c0 7.155-9.517 8.13-20.288 8.13-10.776 0-20.29-.975-20.29-8.13 0-29.96 11.596-29.14 20.29-29.14 8.69 0 20.288-.82 20.288 29.14"/> + <g fill="#3e4347"> + <path d="M35.54 7.59c3.24 0 6.15 1.084 8.156 2.81-.77-2.945-4.135-5.16-8.173-5.16-4.06 0-7.442 2.238-8.186 5.204 2.01-1.753 4.938-2.855 8.204-2.855"/> + <path d="M35.535 11.193c2.217 0 4.21.744 5.584 1.925-.528-2.02-2.835-3.534-5.6-3.534-2.78 0-5.095 1.533-5.605 3.564 1.376-1.198 3.383-1.955 5.62-1.955"/> + </g> + <path fill="#ffe8bb" d="M29.553 43.727l-18.408-7.01 4.24-9.06s2.704 3.85 13.29 6.82l.878 9.243"/> + <path fill="#3e4347" d="M29.37 39.77c-7.462-1.27-16.325-6.673-16.48-6.75l.992-2.168c.184.092 8.806 5.342 15.853 6.544l-.366 2.374"/> + <path fill="#ffe8bb" d="M41.48 43.727l18.406-7.01-4.24-9.06s-2.704 3.85-13.29 6.82l-.876 9.243"/> + <path fill="#3e4347" d="M41.663 39.77c7.46-1.27 16.325-6.673 16.48-6.75l-.993-2.168c-.184.092-8.808 5.342-15.852 6.544l.365 2.374"/> + <g fill="#ffe8bb"> + <path d="M43.524 45.57C38.752 42.023 41.4 33.86 41.4 33.86c-5.657 5.906-12.662 8.74-12.662 8.74 1.608 5.446 5.77 6.412 5.77 6.412-.34-1.835.663-3.302.663-3.302 1.68 2.22 5.03 2.986 5.03 2.986-1.287-1.508-.948-3.835-.948-3.835 2.326.875 4.27.71 4.27.71"/> + <path d="M42.29 42.97c-2.634 2.247-10.917 2.247-13.553 0-2.856-2.435-2.495-7.144.1-9.884 2.397-2.527 10.958-2.527 13.355 0 2.595 2.74 2.956 7.45.098 9.883"/> + </g> + <g fill="#3e4347"> + <path d="M36.18 40.48a.69.69 0 0 1-.644-.477c-.227-.67-.77-3.293-.71-5.498.01-.398.325-.71.7-.698.38.01.674.343.663.74-.057 2.01.46 4.466.633 4.974.127.375-.06.786-.414.92a.607.607 0 0 1-.23.04"/> + <path d="M30.504 43.25c.21-.202.394-.408.582-.61.188-.204.378-.405.57-.604.385-.396.782-.78 1.2-1.145a14.125 14.125 0 0 1 2.745-1.9c.504-.263 1.032-.49 1.59-.654s1.153-.273 1.772-.253c.31.01.623.055.928.146.307.088.602.23.86.416.263.19.485.422.652.684.17.257.287.54.35.83a4.247 4.247 0 0 0-.677-.448 2.567 2.567 0 0 0-.68-.237c-.447-.088-.887-.04-1.33.06-.89.216-1.786.65-2.69 1.114-.905.466-1.818.983-2.776 1.466-.48.24-.97.473-1.48.682-.256.103-.517.202-.783.285-.27.078-.546.155-.833.167"/> + </g> + <path fill="#f15a61" d="M41.34 31.743c-1.17-.528-4.757-.57-5.83-.57-1.07 0-4.66.042-5.83.57-.832.376-.187 1.31 2.027 2.116 1.397.506 2.733.666 3.803.666 1.07 0 2.405-.16 3.805-.667 2.213-.808 2.856-1.74 2.025-2.117"/> + <g fill="#3e4347"> + <path d="M29.917 23.48l1.61 5.292L26.954 26z"/> + <path d="M22.645 31.828c-.522 0-.932-.056-1.17-.098-2.986-.52-4.632-1.996-6.09-4.067l.185-2.472c1.52 1.446 3.953 3.76 6.28 4.167 1.156.2 2.853-.016 4.15-1.234 1.537-1.44 2.263-4.05 2.1-7.547l1.635.132c.2 4.312-.116 7.244-2.212 9.212-1.692 1.59-3.613 1.908-4.878 1.908M41.12 23.48l-1.613 5.292L44.08 26z"/> + <path d="M48.39 31.828c.52 0 .93-.056 1.167-.098 2.99-.52 4.637-1.996 6.09-4.067l-.182-2.472c-1.52 1.446-3.955 3.76-6.28 4.167-1.156.2-2.855-.016-4.154-1.234-1.532-1.44-2.258-4.05-2.095-7.547l-1.636.132c-.202 4.312.114 7.244 2.213 9.212 1.69 1.59 3.61 1.908 4.877 1.908"/> + </g> + <path fill="#ffe8bb" d="M30.25 22.09c-.852 5.282-3.728 5.87-6.696 5.577-2.986-.294-5.396-2.667-5.396-6.743 0-4.28 0-4.28 6.647-5.752 6.728-1.49 6 3.437 5.445 6.918"/> + <path fill="#3e4347" d="M29.16 22.547c-.244 2.534-2.61 4.357-5.287 4.072-2.674-.286-4.645-2.57-4.402-5.102s.28-2.75 5.108-2.237c4.83.514 4.824.737 4.582 3.267"/> + <path fill="#fff" d="M27.59 21.884c-.16 1.688-1.74 2.903-3.522 2.714-1.785-.19-3.096-1.712-2.936-3.4.163-1.69.186-1.835 3.406-1.493 3.22.344 3.215.49 3.053 2.18"/> + <g fill="#3e4347"> + <ellipse cx="25.5" cy="21.08" rx="1.45" ry="1.647"/> + <path d="M31.27 17.896c.42 0 .807-.284.936-.728.16-.546-.133-1.122-.65-1.29l-5.98-1.924c-.516-.166-1.065.14-1.225.685-.155.543.136 1.12.652 1.287l5.98 1.924a.95.95 0 0 0 .288.046"/> + </g> + <path fill="#ffe8bb" d="M40.78 22.09c.855 5.282 3.73 5.87 6.7 5.577 2.984-.294 5.395-2.667 5.395-6.743 0-4.28-.002-4.28-6.646-5.752-6.73-1.49-6.01 3.437-5.45 6.918"/> + <path fill="#3e4347" d="M41.873 22.547c.243 2.534 2.61 4.357 5.287 4.072 2.674-.286 4.646-2.57 4.402-5.102-.242-2.533-.28-2.75-5.107-2.237-4.83.514-4.824.737-4.582 3.267"/> + <path fill="#fff" d="M43.44 21.884c.16 1.688 1.737 2.903 3.522 2.714 1.783-.19 3.098-1.712 2.936-3.4-.16-1.69-.188-1.835-3.404-1.493-3.22.344-3.217.49-3.054 2.18"/> + <g fill="#3e4347"> + <ellipse cx="47.722" cy="20.932" rx="1.45" ry="1.647"/> + <path d="M39.76 17.896a.982.982 0 0 1-.935-.728c-.16-.546.132-1.122.65-1.29l5.98-1.924c.517-.166 1.063.14 1.224.685.155.543-.136 1.12-.653 1.287l-5.98 1.924a.96.96 0 0 1-.287.046"/> + </g> +</svg> diff --git a/doc/context/sources/general/manuals/luametafun/mozilla-svg-002.svg b/doc/context/sources/general/manuals/luametafun/mozilla-svg-002.svg index ac49c531a..6d3126133 100644 --- a/doc/context/sources/general/manuals/luametafun/mozilla-svg-002.svg +++ b/doc/context/sources/general/manuals/luametafun/mozilla-svg-002.svg @@ -1,4 +1,5 @@ -<svg id="glyph651" xmlns="http://www.w3.org/2000/svg"><g fill="#42cde2"> +<svg id="glyph651" xmlns="http://www.w3.org/2000/svg"> + <g fill="#42cde2"> <path d=" M18.06 50.947 l-4.45 3.732.136-9.223 @@ -7,4 +8,4 @@ l-8.54 7.165 a.62.62 0 0 0-.076.874l1.93 2.3a.62.62 0 0 0 .875.074l3.948-3.313-.058 9.45c-.002.147.05.29.144.403l1.845 2.2a.62.62 0 0 0 .874.075l9.102-7.64a.62.62 0 0 0 .077-.874l-1.946-2.318a.623.623 0 0 0-.874-.075M36.03 33.53l-6.464 3.732 2.23-11.648a.812.812 0 0 0-.095-.548l-1.97-3.412a.8.8 0 0 0-1.09-.293l-12.41 7.166a.798.798 0 0 0-.292 1.09l1.928 3.34a.798.798 0 0 0 1.09.293l5.74-3.314-2.184 11.95a.794.794 0 0 0 .093.544l1.846 3.197a.797.797 0 0 0 1.09.29l13.234-7.637a.796.796 0 0 0 .292-1.09l-1.945-3.37a.8.8 0 0 0-1.09-.29M59.33 16.792l-7.794 2.837 4.686-12.316a.894.894 0 0 0 .003-.618l-1.497-4.114a.885.885 0 0 0-1.135-.53L38.63 7.5a.886.886 0 0 0-.53 1.136l1.466 4.03a.884.884 0 0 0 1.136.53l6.92-2.52-4.695 12.658a.888.888 0 0 0-.003.612l1.402 3.854a.888.888 0 0 0 1.137.53l15.953-5.806a.887.887 0 0 0 .53-1.137l-1.48-4.06a.887.887 0 0 0-1.136-.532"/> </g> - </svg> +</svg> diff --git a/metapost/context/base/mpiv/mp-lmtx.mpxl b/metapost/context/base/mpiv/mp-lmtx.mpxl index 46f399dc9..fe84872ea 100644 --- a/metapost/context/base/mpiv/mp-lmtx.mpxl +++ b/metapost/context/base/mpiv/mp-lmtx.mpxl @@ -2012,6 +2012,8 @@ enddef ; presetparameters "svg" [ filename = "", + fontname = "", + % unicode = 0, width = 0, height = 0, ] ; @@ -2020,10 +2022,12 @@ def lmt_svg = applyparameters "svg" "lmt_do_svg" enddef ; vardef lmt_do_svg = save w, h ; - w := getparameter "svg" "width" ; - h := getparameter "svg" "height" ; image ( - lua.mp.lmt_svg_include() + pushparameters "svg" ; + w := getparameter "width" ; + h := getparameter "height" ; + lua.mp.lmt_svg_include() ; + popparameters ; ) if w > 0 : if h > 0 : xysized(w,h) else : xsized(w) fi diff --git a/scripts/context/lua/mtx-install.lua b/scripts/context/lua/mtx-install.lua index fee1ce4d6..48b458897 100644 --- a/scripts/context/lua/mtx-install.lua +++ b/scripts/context/lua/mtx-install.lua @@ -398,7 +398,7 @@ function install.update() local server = environment.arguments.server or "" local instance = environment.arguments.instance or "" - local osplatform = os.platform + local osplatform = environment.arguments.platform or os.platform local platform = platforms[osplatform] if server == "" then diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 1f7be7b72..95df13f9f 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -1171,7 +1171,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-lpeg"] = package.loaded["l-lpeg"] or true --- original size: 38434, stripped down to: 19310 +-- original size: 38440, stripped down to: 19316 if not modules then modules={} end modules ['l-lpeg']={ version=1.001, @@ -1340,7 +1340,7 @@ patterns.propername=(uppercase+lowercase+underscore)*(uppercase+lowercase+unders patterns.somecontent=(anything-newline-space)^1 patterns.beginline=#(1-newline) patterns.longtostring=Cs(whitespace^0/""*((patterns.quoted+nonwhitespace^1+whitespace^1/""*(endofstring+Cc(" ")))^0)) -function anywhere(pattern) +local function anywhere(pattern) return (1-P(pattern))^0*P(pattern) end lpeg.anywhere=anywhere @@ -4628,7 +4628,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-gzip"] = package.loaded["l-gzip"] or true --- original size: 1211, stripped down to: 951 +-- original size: 2980, stripped down to: 2054 if not modules then modules={} end modules ['l-gzip']={ version=1.001, @@ -4636,43 +4636,98 @@ if not modules then modules={} end modules ['l-gzip']={ copyright="PRAGMA ADE / ConTeXt Development Team", license="see context related readme files" } -if not gzip then - return -end -local suffix,suffixes=file.suffix,file.suffixes -function gzip.load(filename) - local f=io.open(filename,"rb") - if not f then - elseif suffix(filename)=="gz" then - f:close() - local g=gzip.open(filename,"rb") - if g then - local str=g:read("*all") - g:close() +if gzip then + local suffix,suffixes=file.suffix,file.suffixes + function gzip.load(filename) + local f=io.open(filename,"rb") + if not f then + elseif suffix(filename)=="gz" then + f:close() + local g=gzip.open(filename,"rb") + if g then + local str=g:read("*all") + g:close() + return str + end + else + local str=f:read("*all") + f:close() return str end - else - local str=f:read("*all") - f:close() - return str end -end -function gzip.save(filename,data) - if suffix(filename)~="gz" then - filename=filename..".gz" + function gzip.save(filename,data) + if suffix(filename)~="gz" then + filename=filename..".gz" + end + local f=io.open(filename,"wb") + if f then + local s=zlib.compress(data or "",9,nil,15+16) + f:write(s) + f:close() + return #s + end end - local f=io.open(filename,"wb") - if f then - local s=zlib.compress(data or "",9,nil,15+16) - f:write(s) - f:close() - return #s + function gzip.suffix(filename) + local suffix,extra=suffixes(filename) + local gzipped=extra=="gz" + return suffix,gzipped end +else end -function gzip.suffix(filename) - local suffix,extra=suffixes(filename) - local gzipped=extra=="gz" - return suffix,gzipped +if flate then + local type=type + local find=string.find + local compress=flate.gz_compress + local decompress=flate.gz_decompress + local absmax=128*1024*1024 + local initial=64*1024 + local identifier="^\x1F\x8B\x08" + function gzip.compressed(s) + return s and find(s,identifier) + end + function gzip.compress(s,level) + if s and not find(s,identifier) then + if not level then + level=3 + elseif level<=0 then + return s + elseif level>9 then + level=9 + end + return compress(s,level) or s + end + end + function gzip.decompress(s,size,iterate) + if s and find(s,identifier) then + if type(size)~="number" then + size=initial + end + if size>absmax then + size=absmax + end + if type(iterate)=="number" then + max=size*iterate + elseif iterate==nil or iterate==true then + iterate=true + max=absmax + end + if max>absmax then + max=absmax + end + while true do + local d=decompress(s,size) + if d then + return d + end + size=2*size + if not iterate or size>max then + return false + end + end + else + return s + end + end end @@ -12547,7 +12602,7 @@ do -- create closure to overcome 200 locals limit package.loaded["trac-set"] = package.loaded["trac-set"] or true --- original size: 13340, stripped down to: 8832 +-- original size: 13348, stripped down to: 8838 if not modules then modules={} end modules ['trac-set']={ version=1.001, @@ -12568,10 +12623,10 @@ local setters=utilities.setters or {} utilities.setters=setters local data={} local trace_initialize=false +local frozen=true function setters.initialize(filename,name,values) local setter=data[name] if setter then - frozen=true local data=setter.data if data then for key,newvalue in sortedhash(values) do @@ -16326,7 +16381,7 @@ do -- create closure to overcome 200 locals limit package.loaded["lxml-tab"] = package.loaded["lxml-tab"] or true --- original size: 61155, stripped down to: 35846 +-- original size: 61191, stripped down to: 35864 if not modules then modules={} end modules ['lxml-tab']={ version=1.001, @@ -17200,12 +17255,14 @@ publicentityfile+publicdoctype+systemdoctype+definitiondoctype+simpledoctype)*op } return grammar_parsed_text_one,grammar_parsed_text_two,grammar_unparsed_text end -grammar_parsed_text_one_nop, -grammar_parsed_text_two_nop, -grammar_unparsed_text_nop=install(space,spacing,anything) -grammar_parsed_text_one_yes, -grammar_parsed_text_two_yes, -grammar_unparsed_text_yes=install(space_nl,spacing_nl,anything_nl) +local + grammar_parsed_text_one_nop, + grammar_parsed_text_two_nop, + grammar_unparsed_text_nop=install(space,spacing,anything) +local + grammar_parsed_text_one_yes, + grammar_parsed_text_two_yes, + grammar_unparsed_text_yes=install(space_nl,spacing_nl,anything_nl) local function _xmlconvert_(data,settings,detail) settings=settings or {} preparexmlstate(settings) @@ -25783,8 +25840,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1029417 --- stripped bytes : 408085 +-- original bytes : 1031236 +-- stripped bytes : 408771 -- end library merge diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 1f7be7b72..95df13f9f 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -1171,7 +1171,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-lpeg"] = package.loaded["l-lpeg"] or true --- original size: 38434, stripped down to: 19310 +-- original size: 38440, stripped down to: 19316 if not modules then modules={} end modules ['l-lpeg']={ version=1.001, @@ -1340,7 +1340,7 @@ patterns.propername=(uppercase+lowercase+underscore)*(uppercase+lowercase+unders patterns.somecontent=(anything-newline-space)^1 patterns.beginline=#(1-newline) patterns.longtostring=Cs(whitespace^0/""*((patterns.quoted+nonwhitespace^1+whitespace^1/""*(endofstring+Cc(" ")))^0)) -function anywhere(pattern) +local function anywhere(pattern) return (1-P(pattern))^0*P(pattern) end lpeg.anywhere=anywhere @@ -4628,7 +4628,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-gzip"] = package.loaded["l-gzip"] or true --- original size: 1211, stripped down to: 951 +-- original size: 2980, stripped down to: 2054 if not modules then modules={} end modules ['l-gzip']={ version=1.001, @@ -4636,43 +4636,98 @@ if not modules then modules={} end modules ['l-gzip']={ copyright="PRAGMA ADE / ConTeXt Development Team", license="see context related readme files" } -if not gzip then - return -end -local suffix,suffixes=file.suffix,file.suffixes -function gzip.load(filename) - local f=io.open(filename,"rb") - if not f then - elseif suffix(filename)=="gz" then - f:close() - local g=gzip.open(filename,"rb") - if g then - local str=g:read("*all") - g:close() +if gzip then + local suffix,suffixes=file.suffix,file.suffixes + function gzip.load(filename) + local f=io.open(filename,"rb") + if not f then + elseif suffix(filename)=="gz" then + f:close() + local g=gzip.open(filename,"rb") + if g then + local str=g:read("*all") + g:close() + return str + end + else + local str=f:read("*all") + f:close() return str end - else - local str=f:read("*all") - f:close() - return str end -end -function gzip.save(filename,data) - if suffix(filename)~="gz" then - filename=filename..".gz" + function gzip.save(filename,data) + if suffix(filename)~="gz" then + filename=filename..".gz" + end + local f=io.open(filename,"wb") + if f then + local s=zlib.compress(data or "",9,nil,15+16) + f:write(s) + f:close() + return #s + end end - local f=io.open(filename,"wb") - if f then - local s=zlib.compress(data or "",9,nil,15+16) - f:write(s) - f:close() - return #s + function gzip.suffix(filename) + local suffix,extra=suffixes(filename) + local gzipped=extra=="gz" + return suffix,gzipped end +else end -function gzip.suffix(filename) - local suffix,extra=suffixes(filename) - local gzipped=extra=="gz" - return suffix,gzipped +if flate then + local type=type + local find=string.find + local compress=flate.gz_compress + local decompress=flate.gz_decompress + local absmax=128*1024*1024 + local initial=64*1024 + local identifier="^\x1F\x8B\x08" + function gzip.compressed(s) + return s and find(s,identifier) + end + function gzip.compress(s,level) + if s and not find(s,identifier) then + if not level then + level=3 + elseif level<=0 then + return s + elseif level>9 then + level=9 + end + return compress(s,level) or s + end + end + function gzip.decompress(s,size,iterate) + if s and find(s,identifier) then + if type(size)~="number" then + size=initial + end + if size>absmax then + size=absmax + end + if type(iterate)=="number" then + max=size*iterate + elseif iterate==nil or iterate==true then + iterate=true + max=absmax + end + if max>absmax then + max=absmax + end + while true do + local d=decompress(s,size) + if d then + return d + end + size=2*size + if not iterate or size>max then + return false + end + end + else + return s + end + end end @@ -12547,7 +12602,7 @@ do -- create closure to overcome 200 locals limit package.loaded["trac-set"] = package.loaded["trac-set"] or true --- original size: 13340, stripped down to: 8832 +-- original size: 13348, stripped down to: 8838 if not modules then modules={} end modules ['trac-set']={ version=1.001, @@ -12568,10 +12623,10 @@ local setters=utilities.setters or {} utilities.setters=setters local data={} local trace_initialize=false +local frozen=true function setters.initialize(filename,name,values) local setter=data[name] if setter then - frozen=true local data=setter.data if data then for key,newvalue in sortedhash(values) do @@ -16326,7 +16381,7 @@ do -- create closure to overcome 200 locals limit package.loaded["lxml-tab"] = package.loaded["lxml-tab"] or true --- original size: 61155, stripped down to: 35846 +-- original size: 61191, stripped down to: 35864 if not modules then modules={} end modules ['lxml-tab']={ version=1.001, @@ -17200,12 +17255,14 @@ publicentityfile+publicdoctype+systemdoctype+definitiondoctype+simpledoctype)*op } return grammar_parsed_text_one,grammar_parsed_text_two,grammar_unparsed_text end -grammar_parsed_text_one_nop, -grammar_parsed_text_two_nop, -grammar_unparsed_text_nop=install(space,spacing,anything) -grammar_parsed_text_one_yes, -grammar_parsed_text_two_yes, -grammar_unparsed_text_yes=install(space_nl,spacing_nl,anything_nl) +local + grammar_parsed_text_one_nop, + grammar_parsed_text_two_nop, + grammar_unparsed_text_nop=install(space,spacing,anything) +local + grammar_parsed_text_one_yes, + grammar_parsed_text_two_yes, + grammar_unparsed_text_yes=install(space_nl,spacing_nl,anything_nl) local function _xmlconvert_(data,settings,detail) settings=settings or {} preparexmlstate(settings) @@ -25783,8 +25840,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1029417 --- stripped bytes : 408085 +-- original bytes : 1031236 +-- stripped bytes : 408771 -- end library merge diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 1f7be7b72..95df13f9f 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -1171,7 +1171,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-lpeg"] = package.loaded["l-lpeg"] or true --- original size: 38434, stripped down to: 19310 +-- original size: 38440, stripped down to: 19316 if not modules then modules={} end modules ['l-lpeg']={ version=1.001, @@ -1340,7 +1340,7 @@ patterns.propername=(uppercase+lowercase+underscore)*(uppercase+lowercase+unders patterns.somecontent=(anything-newline-space)^1 patterns.beginline=#(1-newline) patterns.longtostring=Cs(whitespace^0/""*((patterns.quoted+nonwhitespace^1+whitespace^1/""*(endofstring+Cc(" ")))^0)) -function anywhere(pattern) +local function anywhere(pattern) return (1-P(pattern))^0*P(pattern) end lpeg.anywhere=anywhere @@ -4628,7 +4628,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-gzip"] = package.loaded["l-gzip"] or true --- original size: 1211, stripped down to: 951 +-- original size: 2980, stripped down to: 2054 if not modules then modules={} end modules ['l-gzip']={ version=1.001, @@ -4636,43 +4636,98 @@ if not modules then modules={} end modules ['l-gzip']={ copyright="PRAGMA ADE / ConTeXt Development Team", license="see context related readme files" } -if not gzip then - return -end -local suffix,suffixes=file.suffix,file.suffixes -function gzip.load(filename) - local f=io.open(filename,"rb") - if not f then - elseif suffix(filename)=="gz" then - f:close() - local g=gzip.open(filename,"rb") - if g then - local str=g:read("*all") - g:close() +if gzip then + local suffix,suffixes=file.suffix,file.suffixes + function gzip.load(filename) + local f=io.open(filename,"rb") + if not f then + elseif suffix(filename)=="gz" then + f:close() + local g=gzip.open(filename,"rb") + if g then + local str=g:read("*all") + g:close() + return str + end + else + local str=f:read("*all") + f:close() return str end - else - local str=f:read("*all") - f:close() - return str end -end -function gzip.save(filename,data) - if suffix(filename)~="gz" then - filename=filename..".gz" + function gzip.save(filename,data) + if suffix(filename)~="gz" then + filename=filename..".gz" + end + local f=io.open(filename,"wb") + if f then + local s=zlib.compress(data or "",9,nil,15+16) + f:write(s) + f:close() + return #s + end end - local f=io.open(filename,"wb") - if f then - local s=zlib.compress(data or "",9,nil,15+16) - f:write(s) - f:close() - return #s + function gzip.suffix(filename) + local suffix,extra=suffixes(filename) + local gzipped=extra=="gz" + return suffix,gzipped end +else end -function gzip.suffix(filename) - local suffix,extra=suffixes(filename) - local gzipped=extra=="gz" - return suffix,gzipped +if flate then + local type=type + local find=string.find + local compress=flate.gz_compress + local decompress=flate.gz_decompress + local absmax=128*1024*1024 + local initial=64*1024 + local identifier="^\x1F\x8B\x08" + function gzip.compressed(s) + return s and find(s,identifier) + end + function gzip.compress(s,level) + if s and not find(s,identifier) then + if not level then + level=3 + elseif level<=0 then + return s + elseif level>9 then + level=9 + end + return compress(s,level) or s + end + end + function gzip.decompress(s,size,iterate) + if s and find(s,identifier) then + if type(size)~="number" then + size=initial + end + if size>absmax then + size=absmax + end + if type(iterate)=="number" then + max=size*iterate + elseif iterate==nil or iterate==true then + iterate=true + max=absmax + end + if max>absmax then + max=absmax + end + while true do + local d=decompress(s,size) + if d then + return d + end + size=2*size + if not iterate or size>max then + return false + end + end + else + return s + end + end end @@ -12547,7 +12602,7 @@ do -- create closure to overcome 200 locals limit package.loaded["trac-set"] = package.loaded["trac-set"] or true --- original size: 13340, stripped down to: 8832 +-- original size: 13348, stripped down to: 8838 if not modules then modules={} end modules ['trac-set']={ version=1.001, @@ -12568,10 +12623,10 @@ local setters=utilities.setters or {} utilities.setters=setters local data={} local trace_initialize=false +local frozen=true function setters.initialize(filename,name,values) local setter=data[name] if setter then - frozen=true local data=setter.data if data then for key,newvalue in sortedhash(values) do @@ -16326,7 +16381,7 @@ do -- create closure to overcome 200 locals limit package.loaded["lxml-tab"] = package.loaded["lxml-tab"] or true --- original size: 61155, stripped down to: 35846 +-- original size: 61191, stripped down to: 35864 if not modules then modules={} end modules ['lxml-tab']={ version=1.001, @@ -17200,12 +17255,14 @@ publicentityfile+publicdoctype+systemdoctype+definitiondoctype+simpledoctype)*op } return grammar_parsed_text_one,grammar_parsed_text_two,grammar_unparsed_text end -grammar_parsed_text_one_nop, -grammar_parsed_text_two_nop, -grammar_unparsed_text_nop=install(space,spacing,anything) -grammar_parsed_text_one_yes, -grammar_parsed_text_two_yes, -grammar_unparsed_text_yes=install(space_nl,spacing_nl,anything_nl) +local + grammar_parsed_text_one_nop, + grammar_parsed_text_two_nop, + grammar_unparsed_text_nop=install(space,spacing,anything) +local + grammar_parsed_text_one_yes, + grammar_parsed_text_two_yes, + grammar_unparsed_text_yes=install(space_nl,spacing_nl,anything_nl) local function _xmlconvert_(data,settings,detail) settings=settings or {} preparexmlstate(settings) @@ -25783,8 +25840,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1029417 --- stripped bytes : 408085 +-- original bytes : 1031236 +-- stripped bytes : 408771 -- end library merge diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua index 1f7be7b72..95df13f9f 100644 --- a/scripts/context/stubs/win64/mtxrun.lua +++ b/scripts/context/stubs/win64/mtxrun.lua @@ -1171,7 +1171,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-lpeg"] = package.loaded["l-lpeg"] or true --- original size: 38434, stripped down to: 19310 +-- original size: 38440, stripped down to: 19316 if not modules then modules={} end modules ['l-lpeg']={ version=1.001, @@ -1340,7 +1340,7 @@ patterns.propername=(uppercase+lowercase+underscore)*(uppercase+lowercase+unders patterns.somecontent=(anything-newline-space)^1 patterns.beginline=#(1-newline) patterns.longtostring=Cs(whitespace^0/""*((patterns.quoted+nonwhitespace^1+whitespace^1/""*(endofstring+Cc(" ")))^0)) -function anywhere(pattern) +local function anywhere(pattern) return (1-P(pattern))^0*P(pattern) end lpeg.anywhere=anywhere @@ -4628,7 +4628,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-gzip"] = package.loaded["l-gzip"] or true --- original size: 1211, stripped down to: 951 +-- original size: 2980, stripped down to: 2054 if not modules then modules={} end modules ['l-gzip']={ version=1.001, @@ -4636,43 +4636,98 @@ if not modules then modules={} end modules ['l-gzip']={ copyright="PRAGMA ADE / ConTeXt Development Team", license="see context related readme files" } -if not gzip then - return -end -local suffix,suffixes=file.suffix,file.suffixes -function gzip.load(filename) - local f=io.open(filename,"rb") - if not f then - elseif suffix(filename)=="gz" then - f:close() - local g=gzip.open(filename,"rb") - if g then - local str=g:read("*all") - g:close() +if gzip then + local suffix,suffixes=file.suffix,file.suffixes + function gzip.load(filename) + local f=io.open(filename,"rb") + if not f then + elseif suffix(filename)=="gz" then + f:close() + local g=gzip.open(filename,"rb") + if g then + local str=g:read("*all") + g:close() + return str + end + else + local str=f:read("*all") + f:close() return str end - else - local str=f:read("*all") - f:close() - return str end -end -function gzip.save(filename,data) - if suffix(filename)~="gz" then - filename=filename..".gz" + function gzip.save(filename,data) + if suffix(filename)~="gz" then + filename=filename..".gz" + end + local f=io.open(filename,"wb") + if f then + local s=zlib.compress(data or "",9,nil,15+16) + f:write(s) + f:close() + return #s + end end - local f=io.open(filename,"wb") - if f then - local s=zlib.compress(data or "",9,nil,15+16) - f:write(s) - f:close() - return #s + function gzip.suffix(filename) + local suffix,extra=suffixes(filename) + local gzipped=extra=="gz" + return suffix,gzipped end +else end -function gzip.suffix(filename) - local suffix,extra=suffixes(filename) - local gzipped=extra=="gz" - return suffix,gzipped +if flate then + local type=type + local find=string.find + local compress=flate.gz_compress + local decompress=flate.gz_decompress + local absmax=128*1024*1024 + local initial=64*1024 + local identifier="^\x1F\x8B\x08" + function gzip.compressed(s) + return s and find(s,identifier) + end + function gzip.compress(s,level) + if s and not find(s,identifier) then + if not level then + level=3 + elseif level<=0 then + return s + elseif level>9 then + level=9 + end + return compress(s,level) or s + end + end + function gzip.decompress(s,size,iterate) + if s and find(s,identifier) then + if type(size)~="number" then + size=initial + end + if size>absmax then + size=absmax + end + if type(iterate)=="number" then + max=size*iterate + elseif iterate==nil or iterate==true then + iterate=true + max=absmax + end + if max>absmax then + max=absmax + end + while true do + local d=decompress(s,size) + if d then + return d + end + size=2*size + if not iterate or size>max then + return false + end + end + else + return s + end + end end @@ -12547,7 +12602,7 @@ do -- create closure to overcome 200 locals limit package.loaded["trac-set"] = package.loaded["trac-set"] or true --- original size: 13340, stripped down to: 8832 +-- original size: 13348, stripped down to: 8838 if not modules then modules={} end modules ['trac-set']={ version=1.001, @@ -12568,10 +12623,10 @@ local setters=utilities.setters or {} utilities.setters=setters local data={} local trace_initialize=false +local frozen=true function setters.initialize(filename,name,values) local setter=data[name] if setter then - frozen=true local data=setter.data if data then for key,newvalue in sortedhash(values) do @@ -16326,7 +16381,7 @@ do -- create closure to overcome 200 locals limit package.loaded["lxml-tab"] = package.loaded["lxml-tab"] or true --- original size: 61155, stripped down to: 35846 +-- original size: 61191, stripped down to: 35864 if not modules then modules={} end modules ['lxml-tab']={ version=1.001, @@ -17200,12 +17255,14 @@ publicentityfile+publicdoctype+systemdoctype+definitiondoctype+simpledoctype)*op } return grammar_parsed_text_one,grammar_parsed_text_two,grammar_unparsed_text end -grammar_parsed_text_one_nop, -grammar_parsed_text_two_nop, -grammar_unparsed_text_nop=install(space,spacing,anything) -grammar_parsed_text_one_yes, -grammar_parsed_text_two_yes, -grammar_unparsed_text_yes=install(space_nl,spacing_nl,anything_nl) +local + grammar_parsed_text_one_nop, + grammar_parsed_text_two_nop, + grammar_unparsed_text_nop=install(space,spacing,anything) +local + grammar_parsed_text_one_yes, + grammar_parsed_text_two_yes, + grammar_unparsed_text_yes=install(space_nl,spacing_nl,anything_nl) local function _xmlconvert_(data,settings,detail) settings=settings or {} preparexmlstate(settings) @@ -25783,8 +25840,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1029417 --- stripped bytes : 408085 +-- original bytes : 1031236 +-- stripped bytes : 408771 -- end library merge diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index 0de119aa2..d7278d1a4 100644 --- a/tex/context/base/mkii/cont-new.mkii +++ b/tex/context/base/mkii/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2019.09.29 14:34} +\newcontextversion{2019.10.01 10:36} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/mkii/context.mkii b/tex/context/base/mkii/context.mkii index 422ee53a9..25110cc9f 100644 --- a/tex/context/base/mkii/context.mkii +++ b/tex/context/base/mkii/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2019.09.29 14:34} +\edef\contextversion{2019.10.01 10:36} %D For those who want to use this: diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 0f68e30c3..08c80fddc 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2019.09.29 14:34} +\newcontextversion{2019.10.01 10:36} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index b255f6bcc..a37681efa 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -45,7 +45,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2019.09.29 14:34} +\edef\contextversion{2019.10.01 10:36} \edef\contextkind {beta} %D Kind of special: diff --git a/tex/context/base/mkiv/context.mkxl b/tex/context/base/mkiv/context.mkxl index 9086b1faf..bd0b8591d 100644 --- a/tex/context/base/mkiv/context.mkxl +++ b/tex/context/base/mkiv/context.mkxl @@ -29,7 +29,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2019.09.29 14:34} +\edef\contextversion{2019.10.01 10:36} \edef\contextkind {beta} %D Kind of special: diff --git a/tex/context/base/mkiv/font-dsp.lua b/tex/context/base/mkiv/font-dsp.lua index 79749741c..7777f9c6a 100644 --- a/tex/context/base/mkiv/font-dsp.lua +++ b/tex/context/base/mkiv/font-dsp.lua @@ -3159,6 +3159,14 @@ function readers.cpal(f,fontdata,specification) end end +local compress = gzip and gzip.compress +local compressed = compress and gzip.compressed + +-- At some point I will delay loading and only store the offsets (in context lmtx +-- only). + +-- compressed = false + function readers.svg(f,fontdata,specification) local tableoffset = gotodatatable(f,fontdata,"svg",specification.glyphs) if tableoffset then @@ -3184,10 +3192,14 @@ function readers.svg(f,fontdata,specification) for i=1,nofentries do local entry = entries[i] setposition(f,entry.offset) + local data = readstring(f,entry.length) + if compressed and not compressed(data) then + data = compress(data) + end entries[i] = { first = entry.first, last = entry.last, - data = readstring(f,entry.length) + data = data } end fontdata.svgshapes = entries diff --git a/tex/context/base/mkiv/font-imp-dimensions.lua b/tex/context/base/mkiv/font-imp-dimensions.lua index 518d56345..24891a2cd 100644 --- a/tex/context/base/mkiv/font-imp-dimensions.lua +++ b/tex/context/base/mkiv/font-imp-dimensions.lua @@ -48,13 +48,42 @@ local function initialize(tfmdata,key,value) elseif value == "mono" then newwidth = emwidth else + -- there are fonts out there with no x_height ... local spec = settings_to_array(value) - newwidth = tonumber(spec[1]) - newheight = tonumber(spec[2]) - newdepth = tonumber(spec[3]) - if newwidth then newwidth = newwidth * emwidth end - if newheight then newheight = newheight * exheight end - if newdepth then newdepth = newdepth * exheight end + newwidth = spec[1] + newheight = spec[2] + newdepth = spec[3] + local quad = parameters.quad or 0 + local ascender = parameters.ascender or 0 + local descender = parameters.descender or 0 + if newwidth == "max" then + newwidth = quad + else + newwidth = tonumber(newwidth) + if newwidth then + newwidth = newwidth * emwidth + end + end + if newheight == "max" then + newheight = ascender + else + newheight = tonumber(newheight) + if newheight then + newheight = newheight * exheight + end + end + if newdepth == "max" then + newdepth = descender + else + newdepth = tonumber(newdepth) + if newdepth then + newdepth = newdepth * exheight + end + end + if parameters.x_heigth == 0 then + -- maybe a fourth parameter + parameters.x_heigth = (ascender + descender) / 2 + end end if newwidth or newheight or newdepth then for unicode, character in next, characters do diff --git a/tex/context/base/mkiv/font-ogr.lua b/tex/context/base/mkiv/font-ogr.lua index c441ddbf7..a2e5d2e82 100644 --- a/tex/context/base/mkiv/font-ogr.lua +++ b/tex/context/base/mkiv/font-ogr.lua @@ -51,7 +51,7 @@ do return droppedin end - function dropins.provide(method,clone,t_tfmdata,indexdata,...) + function dropins.provide(method,t_tfmdata,indexdata,...) droppedin = dropins.nextid() local t_characters = t_tfmdata.characters local t_descriptions = t_tfmdata.descriptions @@ -59,12 +59,10 @@ do local d_tfmdata = setmetatableindex({ },t_tfmdata) local d_properties = setmetatableindex({ },t_properties) d_tfmdata.properties = d_properties - if clone then - local d_characters = setmetatableindex({ },t_characters) - local d_descriptions = setmetatableindex({ },t_descriptions) - d_tfmdata.characters = d_characters - d_tfmdata.descriptions = d_descriptions - end + local d_characters = setmetatableindex({ },t_characters) + local d_descriptions = setmetatableindex({ },t_descriptions) + d_tfmdata.characters = d_characters + d_tfmdata.descriptions = d_descriptions d_properties.instance = - droppedin -- will become an extra element in the hash t_properties.virtualized = true identifiers[droppedin] = d_tfmdata @@ -75,19 +73,53 @@ do d_properties.indexdata = { indexdata, ... } -- can take quite some memory local slot = #fonts + 1 fonts[slot] = { id = droppedin } - if not clone then - for k, v in next, t_characters do + return slot, droppedin, d_tfmdata, d_properties + end + + function dropins.clone(method,tfmdata,shapes,...) + if method and shapes then + local characters = tfmdata.characters + local descriptions = tfmdata.descriptions + local droppedin, tfmdrop, dropchars, dropdescs, colrshapes + local idx = 255 + local slot = 0 + -- + for k, v in next, characters do local index = v.index - if index and indexdata[index] then - -- todo: use extender - v.commands = { { "slot", slot, k } } + if index then + local description = descriptions[k] + if description then + local shape = shapes[index] + if shape then + if idx >= 255 then + idx = 1 + colrshapes = { filename = shapes.filename, fixdepth = shapes.fixdepth } -- not needed + slot, droppedin, tfmdrop = dropins.provide(method,tfmdata,colrshapes) + dropchars = tfmdrop.characters + dropdescs = tfmdrop.descriptions + else + idx = idx + 1 + end + colrshapes[idx] = shape -- so not: description + -- +-- local helpers = fonts.helpers +-- local prependcommands = helpers.prependcommands +-- print(v.commands) + v.commands = { { "slot", slot, idx } } + -- hack to prevent that type 3 also gets 'use' flags .. todo + local c = { commands = false, index = idx, dropin = tfmdata } + local d = { index = idx, dropin = tfmdata } + setmetatableindex(c,v) + setmetatableindex(d,description) + dropchars[idx] = c + dropdescs[idx] = d + end + end end end else - -- make sure that the drop characters should get a copy with no commands - -- (false will do) + -- error end - return slot, droppedin, d_tfmdata, d_properties end end @@ -198,15 +230,9 @@ do return end -- - -- todo: delay with lua function or plugin in vf handler, saves a lot of - -- overhead - -- local characters = tfmdata.characters local descriptions = tfmdata.descriptions local droppedin, tfmdrop, dropchars, dropdescs, colrshapes - -- alternative 1: - -- local slots = { } - -- alternative 2: local idx = 255 local slot = 0 -- @@ -217,25 +243,10 @@ do if description then local colorlist = description.colors if colorlist then - -- alternative 1: - -- local fnt = div(index,256) - -- local idx = mod(index,256) - -- local slt = slots[fnt] - -- if not slt then - -- colrshapes = { } - -- slot, droppedin, tfmdrop = fonts.dropins.provide("color",true,tfmdata,colrshapes,colorvalues) - -- slt = { slot, colrshapes, tfmdrop.characters, tfmdrop.descriptions } - -- slots[fnt] = slt - -- end - -- slot = slt[1] - -- colrshapes = slt[2] - -- dropchars = slt[3] - -- dropdescs = slt[4] - -- alternative 2: if idx >= 255 then idx = 1 colrshapes = { } - slot, droppedin, tfmdrop = fonts.dropins.provide("color",true,tfmdata,colrshapes,colorvalues) + slot, droppedin, tfmdrop = fonts.dropins.provide("color",tfmdata,colrshapes,colorvalues) dropchars = tfmdrop.characters dropdescs = tfmdrop.descriptions else @@ -290,6 +301,8 @@ do if not hash then return end + local shapes = nil + local method = nil if cached then -- we need a different hash than for mkiv, so we append: local pdfhash = hash .. "-svg" @@ -299,14 +312,14 @@ do if not pdfshapes or pdffile.timestamp ~= timestamp or not next(pdfshapes) or not lfs.isfile(pdftarget) then local svgfile = containers.read(otf.svgcache,hash) local svgshapes = svgfile and svgfile.svgshapes - pdfshapes = svgshapes and metapost.svgshapestopdf(svgshapes,pdftarget,report_svg) or { } + pdfshapes = svgshapes and metapost.svgshapestopdf(svgshapes,pdftarget,report_svg,tfmdata.parameters.units) or { } containers.write(otf.pdfcache, pdfhash, { pdfshapes = pdfshapes, timestamp = timestamp, }) end - -- this can be delayed, no need to keep this in mem - fonts.dropins.provide("pdf",false,tfmdata,pdfshapes) + shapes = pdfshapes + method = "pdf" else local mpsfile = containers.read(otf.mpscache,hash) local mpsshapes = mpsfile and mpsfile.mpsshapes @@ -314,13 +327,18 @@ do local svgfile = containers.read(otf.svgcache,hash) local svgshapes = svgfile and svgfile.svgshapes -- still suboptimal - mpsshapes = svgshapes and metapost.svgshapestomp(svgshapes,report_svg) or { } + mpsshapes = svgshapes and metapost.svgshapestomp(svgshapes,report_svg,tfmdata.parameters.units) or { } containers.write(otf.mpscache, hash, { mpsshapes = mpsshapes, timestamp = timestamp, }) end - fonts.dropins.provide("mps",false,tfmdata,mpsshapes) + shapes = mpsshapes + method = "mps" + end + if shapes then + shapes.fixdepth = value == "fixdepth" + fonts.dropins.clone(method,tfmdata,shapes) end end end @@ -355,7 +373,7 @@ do local pngfile = containers.read(otf.pngcache,hash) local pngshapes = pngfile and pngfile.pngshapes if pngshapes then - fonts.dropins.provide("png",false,tfmdata,pngshapes) + fonts.dropins.clone("png",tfmdata,pngshapes) end end end diff --git a/tex/context/base/mkiv/l-gzip.lua b/tex/context/base/mkiv/l-gzip.lua index 5100e4722..31466bde8 100644 --- a/tex/context/base/mkiv/l-gzip.lua +++ b/tex/context/base/mkiv/l-gzip.lua @@ -5,50 +5,113 @@ if not modules then modules = { } end modules ['l-gzip'] = { license = "see context related readme files" } -if not gzip then +if gzip then - -- no fallback yet + local suffix, suffixes = file.suffix, file.suffixes - return - -end - -local suffix, suffixes = file.suffix, file.suffixes - -function gzip.load(filename) - local f = io.open(filename,"rb") - if not f then - -- invalid file - elseif suffix(filename) == "gz" then - f:close() - local g = gzip.open(filename,"rb") - if g then - local str = g:read("*all") - g:close() + function gzip.load(filename) + local f = io.open(filename,"rb") + if not f then + -- invalid file + elseif suffix(filename) == "gz" then + f:close() + local g = gzip.open(filename,"rb") + if g then + local str = g:read("*all") + g:close() + return str + end + else + local str = f:read("*all") + f:close() return str end - else - local str = f:read("*all") - f:close() - return str end -end -function gzip.save(filename,data) - if suffix(filename) ~= "gz" then - filename = filename .. ".gz" + function gzip.save(filename,data) + if suffix(filename) ~= "gz" then + filename = filename .. ".gz" + end + local f = io.open(filename,"wb") + if f then + local s = zlib.compress(data or "",9,nil,15+16) + f:write(s) + f:close() + return #s + end end - local f = io.open(filename,"wb") - if f then - local s = zlib.compress(data or "",9,nil,15+16) - f:write(s) - f:close() - return #s + + function gzip.suffix(filename) + local suffix, extra = suffixes(filename) + local gzipped = extra == "gz" + return suffix, gzipped end + +else + + -- todo: fallback on flate + end -function gzip.suffix(filename) - local suffix, extra = suffixes(filename) - local gzipped = extra == "gz" - return suffix, gzipped +if flate then + + local type = type + local find = string.find + + local compress = flate.gz_compress + local decompress = flate.gz_decompress + + local absmax = 128*1024*1024 + local initial = 64*1024 + local identifier = "^\x1F\x8B\x08" + + function gzip.compressed(s) + return s and find(s,identifier) + end + + function gzip.compress(s,level) + if s and not find(s,identifier) then -- the find check might go away + if not level then + level = 3 + elseif level <= 0 then + return s + elseif level > 9 then + level = 9 + end + return compress(s,level) or s + end + end + + function gzip.decompress(s,size,iterate) + if s and find(s,identifier) then + if type(size) ~= "number" then + size = initial + end + if size > absmax then + size = absmax + end + if type(iterate) == "number" then + max = size * iterate + elseif iterate == nil or iterate == true then + iterate = true + max = absmax + end + if max > absmax then + max = absmax + end + while true do + local d = decompress(s,size) + if d then + return d + end + size = 2 * size + if not iterate or size > max then + return false + end + end + else + return s + end + end + end diff --git a/tex/context/base/mkiv/l-lpeg.lua b/tex/context/base/mkiv/l-lpeg.lua index 51bc1d3df..7979a40fb 100644 --- a/tex/context/base/mkiv/l-lpeg.lua +++ b/tex/context/base/mkiv/l-lpeg.lua @@ -295,7 +295,7 @@ patterns.longtostring = Cs(whitespace^0/"" * ((patterns.quoted + nonwhitespace^ -- return P { P(pattern) + 1 * V(1) } -- end -function anywhere(pattern) -- faster +local function anywhere(pattern) -- faster return (1-P(pattern))^0 * P(pattern) end diff --git a/tex/context/base/mkiv/lpdf-emb.lua b/tex/context/base/mkiv/lpdf-emb.lua index 1cdcac1ae..0447ce9b0 100644 --- a/tex/context/base/mkiv/lpdf-emb.lua +++ b/tex/context/base/mkiv/lpdf-emb.lua @@ -1525,12 +1525,14 @@ do local embedimage = images.embed - local f_glyph = formatters["G%d"] - local f_char = formatters["BT /V%d 1 Tf [<%04X>] TJ ET"] - local f_width = formatters["%.6N 0 d0"] - local f_index = formatters["I%d"] - local f_image = formatters["%.6N 0 d0 /%s Do"] - local f_stream = formatters["%.6N 0 d0 %s"] + local f_glyph = formatters["G%d"] + local f_char = formatters["BT /V%d 1 Tf [<%04X>] TJ ET"] + local f_width = formatters["%.6N 0 d0"] + local f_index = formatters["I%d"] + local f_image = formatters["%.6N 0 d0 /%s Do"] + local f_image_d = formatters["%.6N 0 d0 1 0 0 1 0 %.3N cm /%s Do"] + local f_stream = formatters["%.6N 0 d0 %s"] + local f_stream_d = formatters["%.6N 0 d0 1 0 0 1 0 %.3N cm %s"] -- A type 3 font has at most 256 characters and Acrobat also wants a zero slot -- to be filled. We can share a mandate zero slot character. @@ -1558,6 +1560,9 @@ do return result.glyphs, widthfactor / 65536, scalefactor, readers.pktopdf end + -- not scaling in svg but here using a cm might be more efficient in terms of bytes + -- as we get smaller numbers + -- pdf inclusion function methods.pdf(filename,details) @@ -1567,15 +1572,25 @@ do local xforms = pdfdictionary() local nofglyphs = 0 if pdfdoc then + local scale = 10 * details.parameters.size/details.parameters.designsize + local units = details.parameters.units + local factor = units * bpfactor / scale + local fixdepth = pdfshapes.fixdepth local function pdftopdf(glyph,width,data) local image = copypage(pdfdoc,glyph) - width = 100 * width * bpfactor embedimage(image) + width = width * factor nofglyphs = nofglyphs + 1 local name = f_glyph(nofglyphs) xforms[name] = pdfreference(image.objnum) - local pdf = f_image(width,name) - return pdf, width + if fixdepth then + local depth = data.depth or 0 + local height = data.height or 0 + if depth ~= 0 or height ~= 0 then + return f_stream_d(width,(-height-depth)*factor,pdf), width + end + end + return f_image(width,name), width end local function closepdf() -- closepdf(pdfdoc) @@ -1583,27 +1598,44 @@ do local function getresources() return pdfdictionary { XObject = xforms } end - return pdfshapes, 1, 0.001, pdftopdf, closepdf, getresources + return pdfshapes, 1, 1/units, pdftopdf, closepdf, getresources end end -- mps inclusion + local decompress = gzip.decompress + function methods.mps(filename,details) local properties = details.properties local mpshapes = properties.indexdata[1] - local function mpstopdf(mp,width,data) - local pdf = metapost.simple("metafun",mp,true) -- can be sped up, minifun - local width = 100 * width * bpfactor - local stream = f_stream(width,pdf) - return stream, width - end - local function getresources() - return lpdf.collectedresources { - serialize = false, - } + if mpshapes then + local scale = 10 * details.parameters.size/details.parameters.designsize + local units = details.parameters.units + local factor = units * bpfactor / scale + local fixdepth = mpshapes.fixdepth + local function mpstopdf(mp,width,data) + if decompress then + mp = decompress(mp) + end + local pdf = metapost.simple("metafun",mp,true) -- can be sped up, minifun + local width = width * factor + if fixdepth then + local depth = data.depth or 0 + local height = data.height or 0 + if depth ~= 0 or height ~= 0 then + return f_stream_d(width,(-height-depth)*factor,pdf), width + end + end + return f_stream(width,pdf), width + end + local function getresources() + return lpdf.collectedresources { + serialize = false, + } + end + return mpshapes, 1, 1/units, mpstopdf, nil, getresources end - return mpshapes, 1, 0.001, mpstopdf, nil, getresources end -- png inclusion @@ -1625,13 +1657,8 @@ do local function pngtopdf(glyph,width,data) local info = graphics.identifiers.png(glyph.data,"string") local image = lpdf.injectors.png(info,"string") - local bbox = image.bbox - local llx = bbox[1] * bpfactor - local lly = bbox[2] * bpfactor - local urx = bbox[3] * bpfactor - local ury = bbox[4] * bpfactor - width = width * bpfactor / 10 embedimage(image) + width = width * bpfactor / 10 nofglyphs = nofglyphs + 1 local name = f_glyph(nofglyphs) xforms[name] = pdfreference(image.objnum) @@ -1659,7 +1686,7 @@ do if colorlist then local dropdata = data.dropin local dropid = dropdata.properties.id - local dropunits = dropdata.parameters.units + local dropunits = dropdata.parameters.units -- shared usedfonts[dropid] = dropid local w = description.width or 0 @@ -1668,7 +1695,6 @@ do local t = { f_width(w) } local n = 1 local d = colrvalues[#colrvalues] - for i=1,s do local entry = colorlist[i] local v = colrvalues[entry.class] or d @@ -1740,7 +1766,6 @@ do for i=1,maxindex-minindex+1 do widths[i] = 0 end - for index, data in sortedhash(indices) do local name = f_index(index) local glyph = glyphs[index] @@ -1773,7 +1798,11 @@ do Differences = differences, } local tounicode = tounicodedictionary(details,indices,maxindex,basefontname) - local resources = getresources and getresources() or lpdf.procset(true) + local resources = getresources and getresources() + if not resources or not next(resources) then + -- resources = lpdf.procset(true) + resources = nil + end local descriptor = pdfdictionary { -- most is optional in type3 Type = pdfconstant("FontDescriptor"), @@ -1794,7 +1823,7 @@ do Widths = pdfreference(pdfflushobject(widths)), FontDescriptor = pdfreference(pdfflushobject(descriptor)), Resources = resources, - ToUnicode = pdfreference(pdfflushstreamobject(tounicode)), + ToUnicode = tounicode and pdfreference(pdfflushstreamobject(tounicode)), } pdfflushobject(object,parent) if reset then diff --git a/tex/context/base/mkiv/lxml-tab.lua b/tex/context/base/mkiv/lxml-tab.lua index 3ade1c92b..8f6379f2f 100644 --- a/tex/context/base/mkiv/lxml-tab.lua +++ b/tex/context/base/mkiv/lxml-tab.lua @@ -1160,13 +1160,15 @@ publicentityfile + end -grammar_parsed_text_one_nop , -grammar_parsed_text_two_nop , -grammar_unparsed_text_nop = install(space, spacing, anything) - -grammar_parsed_text_one_yes , -grammar_parsed_text_two_yes , -grammar_unparsed_text_yes = install(space_nl, spacing_nl, anything_nl) +local + grammar_parsed_text_one_nop , + grammar_parsed_text_two_nop , + grammar_unparsed_text_nop = install(space, spacing, anything) + +local + grammar_parsed_text_one_yes , + grammar_parsed_text_two_yes , + grammar_unparsed_text_yes = install(space_nl, spacing_nl, anything_nl) -- maybe we will add settings to result as well diff --git a/tex/context/base/mkiv/mlib-ctx.mkiv b/tex/context/base/mkiv/mlib-ctx.mkiv index 860cb688c..a1ed7efeb 100644 --- a/tex/context/base/mkiv/mlib-ctx.mkiv +++ b/tex/context/base/mkiv/mlib-ctx.mkiv @@ -20,7 +20,7 @@ \registerctxluafile{mlib-int}{} \doifelsefileexists{mlib-cnt.lua}{\registerctxluafile{mlib-cnt}{optimize}}{} -\doifelsefileexists{mlib-svg.lua}{\registerctxluafile{mlib-svg}{}}{} +\doifelsefileexists{mlib-svg.lua}{\registerctxluafile{mlib-svg}{optimize}}{} \unprotect diff --git a/tex/context/base/mkiv/mlib-lmp.lua b/tex/context/base/mkiv/mlib-lmp.lua index 22607be8d..dc130c2fd 100644 --- a/tex/context/base/mkiv/mlib-lmp.lua +++ b/tex/context/base/mkiv/mlib-lmp.lua @@ -6,10 +6,11 @@ if not modules then modules = { } end modules ['mlib-lmp'] = { license = "see context related readme files", } -local aux = mp.aux -local mpnumeric = aux.numeric -local mppair = aux.pair -local mpquoted = aux.quoted +local aux = mp.aux +local mpnumeric = aux.numeric +local mppair = aux.pair +local mpquoted = aux.quoted +local mpdirect = aux.direct -- todo: use a stack? @@ -136,9 +137,20 @@ do end function mp.lmt_svg_include() - local name = metapost.getparameter { "svg", "filename" } - local mps = metapost.svgtomp { - data = name and name ~= "" and io.loaddata(name) or "", - } - mp.direct(mps) + local filename = metapost.getparameter { "filename" } + local fontname = metapost.getparameter { "fontname" } + local metacode = nil + if fontname and fontname ~= "" then + local unicode = metapost.getparameter { "unicode" } + if unicode then + metacode = metapost.svgglyphtomp(fontname,math.round(unicode)) + end + elseif filename and filename ~= "" then + metacode = metapost.svgtomp { + data = io.loaddata(filename) + } + end + if metacode then + mpdirect(metacode) + end end diff --git a/tex/context/base/mkiv/mlib-svg.lua b/tex/context/base/mkiv/mlib-svg.lua index c3635480d..d9156d2e8 100644 --- a/tex/context/base/mkiv/mlib-svg.lua +++ b/tex/context/base/mkiv/mlib-svg.lua @@ -16,22 +16,25 @@ if not modules then modules = { } end modules ['mlib-svg'] = { -- Written with Anne Clark on speakers as distraction. --- TODO: - +-- Todo when I run into an example: +-- +-- var(color,color) +-- --color<decimal> +-- currentColor : when i run into an example +-- some more fonts +-- +-- Todo: some day +-- -- optimize --- test for gzip header 0x1F 0x8B 0x08 --- var() --- color hash --- currentColor -- instances --- --color<decimal> --- glyph<id> +-- withpen -> pickup +-- +-- Todo: when i am motivated +-- -- shading -- "none" -> false -- clip = [ auto | rect(llx,lly,urx,ury) ] (in svg) -- xlink url ... whatever --- mp svg module + shortcuts --- withpen -> pickup -- The fact that in the more recent versions of SVG the older text related elements -- are depricated and not even supposed to be supported, combined with the fact that @@ -54,6 +57,7 @@ local pi, sin, cos, asin, sind, cosd, tan, abs, sqrt = math.pi, math.sin, math.c local concat, setmetatableindex = table.concat, table.setmetatableindex local gmatch, gsub, find, match, rep = string.gmatch, string.gsub, string.find, string.match, string.rep local formatters = string.formatters +local extract = bit32.extract local xmlconvert, xmlcollected, xmlcount, xmlfirst, xmlroot, xmltext = xml.convert, xml.collected, xml.count, xml.first, xml.root, xml.text @@ -138,6 +142,13 @@ local f_transform_stop = formatters[") %s ;"] local s_offset_start = "draw image ( " local f_offset_stop = formatters[") shifted (%.3N,%.3N) ;"] +local s_scaled_start = "draw image ( " +local f_scaled_stop = formatters[") scaled %.3N ;"] + +local s_hacked_start = "draw image (" +local f_hacked_stop = formatters[") shifted (0,%.3N) scaled %.3N ;"] +-- local f_hacked_stop = formatters[") scaled %.3N ;"] + local f_viewport_start = "draw image (" local f_viewport_stop = ") ;" local f_viewport_shift = formatters["currentpicture := currentpicture shifted (%03N,%03N);"] @@ -161,6 +172,171 @@ local f_shade_two = formatters['withprescript "sh_center_b=%.3N %.3N"'] local f_text_scaled = formatters['(textext.drt("%s") scaled %.3N shifted (%.3N,%.3N))'] local f_text_normal = formatters['(textext.drt("%s") shifted (%.3N,%.3N))'] +-- We can actually use the svg color definitions from the tex end but maybe a user doesn't +-- want those replace the normal definitions. + +local svgcolors = { + black = 0x000000, + navy = 0x000080, + darkblue = 0x00008B, + mediumblue = 0x0000CD, + blue = 0x0000FF, + darkgreen = 0x006400, + green = 0x008000, + teal = 0x008080, + darkcyan = 0x008B8B, + deepskyblue = 0x00BFFF, + darkturquoise = 0x00CED1, + mediumspringgreen = 0x00FA9A, + lime = 0x00FF00, + springgreen = 0x00FF7F, + cyan = 0x00FFFF, + aqua = 0x00FFFF, + midnightblue = 0x191970, + dodgerblue = 0x1E90FF, + lightseagreen = 0x20B2AA, + forestgreen = 0x228B22, + seagreen = 0x2E8B57, + darkslategray = 0x2F4F4F, + darkslategrey = 0x2F4F4F, + limegreen = 0x32CD32, + mediumseagreen = 0x3CB371, + turquoise = 0x40E0D0, + royalblue = 0x4169E1, + steelblue = 0x4682B4, + darkslateblue = 0x483D8B, + mediumturquoise = 0x48D1CC, + indigo = 0x4B0082, + darkolivegreen = 0x556B2F, + cadetblue = 0x5F9EA0, + cornflowerblue = 0x6495ED, + mediumaquamarine = 0x66CDAA, + dimgrey = 0x696969, + dimgray = 0x696969, + slateblue = 0x6A5ACD, + olivedrab = 0x6B8E23, + slategrey = 0x708090, + slategray = 0x708090, + lightslategray = 0x778899, + lightslategrey = 0x778899, + mediumslateblue = 0x7B68EE, + lawngreen = 0x7CFC00, + chartreuse = 0x7FFF00, + aquamarine = 0x7FFFD4, + maroon = 0x800000, + purple = 0x800080, + olive = 0x808000, + gray = 0x808080, + grey = 0x808080, + skyblue = 0x87CEEB, + lightskyblue = 0x87CEFA, + blueviolet = 0x8A2BE2, + darkred = 0x8B0000, + darkmagenta = 0x8B008B, + saddlebrown = 0x8B4513, + darkseagreen = 0x8FBC8F, + lightgreen = 0x90EE90, + mediumpurple = 0x9370DB, + darkviolet = 0x9400D3, + palegreen = 0x98FB98, + darkorchid = 0x9932CC, + yellowgreen = 0x9ACD32, + sienna = 0xA0522D, + brown = 0xA52A2A, + darkgray = 0xA9A9A9, + darkgrey = 0xA9A9A9, + lightblue = 0xADD8E6, + greenyellow = 0xADFF2F, + paleturquoise = 0xAFEEEE, + lightsteelblue = 0xB0C4DE, + powderblue = 0xB0E0E6, + firebrick = 0xB22222, + darkgoldenrod = 0xB8860B, + mediumorchid = 0xBA55D3, + rosybrown = 0xBC8F8F, + darkkhaki = 0xBDB76B, + silver = 0xC0C0C0, + mediumvioletred = 0xC71585, + indianred = 0xCD5C5C, + peru = 0xCD853F, + chocolate = 0xD2691E, + tan = 0xD2B48C, + lightgray = 0xD3D3D3, + lightgrey = 0xD3D3D3, + thistle = 0xD8BFD8, + orchid = 0xDA70D6, + goldenrod = 0xDAA520, + palevioletred = 0xDB7093, + crimson = 0xDC143C, + gainsboro = 0xDCDCDC, + plum = 0xDDA0DD, + burlywood = 0xDEB887, + lightcyan = 0xE0FFFF, + lavender = 0xE6E6FA, + darksalmon = 0xE9967A, + violet = 0xEE82EE, + palegoldenrod = 0xEEE8AA, + lightcoral = 0xF08080, + khaki = 0xF0E68C, + aliceblue = 0xF0F8FF, + honeydew = 0xF0FFF0, + azure = 0xF0FFFF, + sandybrown = 0xF4A460, + wheat = 0xF5DEB3, + beige = 0xF5F5DC, + whitesmoke = 0xF5F5F5, + mintcream = 0xF5FFFA, + ghostwhite = 0xF8F8FF, + salmon = 0xFA8072, + antiquewhite = 0xFAEBD7, + linen = 0xFAF0E6, + lightgoldenrodyellow = 0xFAFAD2, + oldlace = 0xFDF5E6, + red = 0xFF0000, + fuchsia = 0xFF00FF, + magenta = 0xFF00FF, + deeppink = 0xFF1493, + orangered = 0xFF4500, + tomato = 0xFF6347, + hotpink = 0xFF69B4, + coral = 0xFF7F50, + darkorange = 0xFF8C00, + lightsalmon = 0xFFA07A, + orange = 0xFFA500, + lightpink = 0xFFB6C1, + pink = 0xFFC0CB, + gold = 0xFFD700, + peachpuff = 0xFFDAB9, + navajowhite = 0xFFDEAD, + moccasin = 0xFFE4B5, + bisque = 0xFFE4C4, + mistyrose = 0xFFE4E1, + blanchedalmond = 0xFFEBCD, + papayawhip = 0xFFEFD5, + lavenderblush = 0xFFF0F5, + seashell = 0xFFF5EE, + cornsilk = 0xFFF8DC, + lemonchiffon = 0xFFFACD, + floralwhite = 0xFFFAF0, + snow = 0xFFFAFA, + yellow = 0xFFFF00, + lightyellow = 0xFFFFE0, + ivory = 0xFFFFF0, + white = 0xFFFFFF, +} + +local svgcolor = setmetatableindex(function(t,k) + -- we delay building all these strings + local v = svgcolors[k] + if v then + v = f_rgb(extract(v,16,8),extract(v,8,8),extract(v,0,8)) + else + v = false + end + t[k] = v + return v +end) + local p_digit = lpegpatterns.digit local p_hexdigit = lpegpatterns.hexdigit local p_space = lpegpatterns.whitespace @@ -627,7 +803,8 @@ local function grabpath(str) prev = "C" goto continue ::close:: - n = n + 1 ; t[n] = prev == "C" and "..cycle" or "--cycle" + -- n = n + 1 ; t[n] = prev == "C" and "..cycle" or "--cycle" + n = n + 1 ; t[n] = "--cycle" if n > 0 then a = a + 1 ; all[a] = concat(t,"",1,n) ; n = 0 end @@ -915,7 +1092,7 @@ do local colorb = a["stop-color"] local opacity = a["stop-opacity"] - colorb = colorb and hexcolor3(colorb) or colorb + colorb = colorb and (hexcolor3(colorb) or svgcolor[colorb] or colorb) colora = colora or colorb -- what if no percentage @@ -959,7 +1136,7 @@ do if not c then c = rgbacolor(stroke) if not c then - c = f_color(stroke) + c = f_color(svgcolor[stroke] or stroke) end end local o = a["stroke-opacity"] or a.opacity @@ -981,7 +1158,7 @@ do if not c then c = hexcolor(fill) if not c then - c = f_color(fill) + c = f_color(svgcolor[fill] or fill) end end local o = a["fill-opacity"] or a.opacity @@ -1018,7 +1195,9 @@ do local function viewport(x,y,w,h,noclip) r = r + 1 ; result[r] = f_viewport_start return function() - r = r + 1 ; result[r] = f_viewport_shift(-x,y) + if x ~= 0 or y ~= 0 then + r = r + 1 ; result[r] = f_viewport_shift(-x,y) + end if not noclip then r = r + 1 ; result[r] = f_viewport_clip(w,-h) end @@ -1372,14 +1551,22 @@ do r = r + 1 ; result[r] = text end - function handlers.svg(c,top,x,y,w,h,noclip) + function handlers.svg(c,top,x,y,w,h,noclip,notransform,normalize) local a = setmetatableindex(c.at,top) local v = a.viewBox local t = a.transform local wrapupoffset local wrapupviewport + local btransform + local etransform + local bhacked + local ehacked + local wd = w -- local ex, em local xpct, ypct, rpct + if notransform then +-- t = nil + end if trace then report("view: %s, xpct %.3N, ypct %.3N","before",percentage_x,percentage_y) end @@ -1411,14 +1598,25 @@ do if t then btransform, etransform = transform(t,true) end + -- some fonts need this (bad transforms + viewbox) + if v and normalize and w and wd and w ~= wd and w > 0 and wd > 0 then + bhacked = s_hacked_start + ehacked = f_hacked_stop(y or 0,wd/w) + end if btransform then r = r + 1 ; result[r] = btransform end + if bhacked then + r = r + 1 ; result[r] = bhacked + end wrapupoffset = offset(a) process(c,"/*",top or defaults) if wrapupoffset then wrapupoffset() end + if ehacked then + r = r + 1 ; result[r] = ehacked + end if etransform then r = r + 1 ; result[r] = etransform end @@ -1448,7 +1646,7 @@ do end end - function metapost.svgtomp(specification,pattern) + function metapost.svgtomp(specification,pattern,notransform,normalize) local mps = "" local svg = specification.data if type(svg) == "string" then @@ -1464,9 +1662,11 @@ do nil, specification.x, specification.y, - specification.w, - specification.h, - specification.noclip + specification.width, + specification.height, + specification.noclip, + notransform, + normalize ) mps = concat(result," ") root, result, r, definitions, styles, bodyfont = false, false, false, false, false, false @@ -1481,6 +1681,8 @@ do end +-- These helpers might move to their own module .. some day ... + function metapost.showsvgpage(data) local dd = data.data if type(dd) == "table" then @@ -1533,6 +1735,9 @@ do -- cache. This is the old method updated. Maybe a future version will just do this runtime -- but for now this is the most efficient method. + local decompress = gzip.decompress + local compress = gzip.compress + function metapost.svgshapestopdf(svgshapes,pdftarget,report_svg) local texname = "temp-otf-svg-to-pdf.tex" local pdfname = "temp-otf-svg-to-pdf.pdf" @@ -1566,6 +1771,9 @@ do for i=1,nofshapes do local entry = svgshapes[i] local data = entry.data + if decompress then + data = decompress(data,128*1024) or data + end local specification = { data = xmlconvert(data), x = 0, @@ -1580,7 +1788,7 @@ do pdfpages[index] = pdfpage local pattern = "/svg[@id='glyph" .. index .. "']" n = n + 1 ; t[n] = "\\startMPpage" - n = n + 1 ; t[n] = metapost.svgtomp(specification,pattern) or "" + n = n + 1 ; t[n] = metapost.svgtomp(specification,pattern,true,true) or "" n = n + 1 ; t[n] = "\\stopMPpage" end end @@ -1610,6 +1818,9 @@ do for i=1,nofshapes do local entry = svgshapes[i] local data = entry.data + if decompress then + data = decompress(data,128*1024) or data + end local specification = { data = xmlconvert(data), x = 0, @@ -1621,7 +1832,11 @@ do for index=entry.first,entry.last do if not mpshapes[index] then local pattern = "/svg[@id='glyph" .. index .. "']" - mpshapes[index] = metapost.svgtomp(specification,pattern) or "" + local mpcode = metapost.svgtomp(specification,pattern,true,true) or "" + if mpcode ~= "" and compress then + mpcode = compress(mpcode) or mpcode + end + mpshapes[index] = mpcode end end end @@ -1632,4 +1847,54 @@ do return mpshapes end + function metapost.svgglyphtomp(fontname,unicode) + if fontname and unicode then + local id = fonts.definers.internal { name = fontname } + if id then + local tfmdata = fonts.hashes.identifiers[id] + if tfmdata then + local properties = tfmdata.properties + local svg = properties.svg + local hash = svg and svg.hash + local timestamp = svg and svg.timestamp + if hash then + local svgfile = containers.read(fonts.handlers.otf.svgcache,hash) + local svgshapes = svgfile and svgfile.svgshapes + if svgshapes then + if type(unicode) == "string" then + unicode = utf.byte(unicode) + end + local chardata = tfmdata.characters[unicode] + local index = chardata and chardata.index + if index then + for i=1,#svgshapes do + local entry = svgshapes[i] + if index >= entry.first and index <= entry.last then + local data = entry.data + if data then + local root = xml.convert(gzip.decompress(data,128*1024) or data) + return metapost.svgtomp ( + { + data = root, + x = 0, + y = 1000, + width = 1000, + height = 1000, + noclip = true, + }, + "/svg[@id='glyph" .. index .. "']", + true, + true + ) + end + end + end + end + end + end + end + end + end + end + end diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex 13226aea6..9298a31e7 100644 --- a/tex/context/base/mkiv/status-files.pdf +++ b/tex/context/base/mkiv/status-files.pdf diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf Binary files differindex 71314c8ea..6f7d7e6b5 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkiv/trac-set.lua b/tex/context/base/mkiv/trac-set.lua index 4a22282a8..d43fd6d0d 100644 --- a/tex/context/base/mkiv/trac-set.lua +++ b/tex/context/base/mkiv/trac-set.lua @@ -30,11 +30,11 @@ local data = { } -- The sorting is needed to get a predictable setters in case of *. local trace_initialize = false -- only for testing during development +local frozen = true -- this needs checking function setters.initialize(filename,name,values) -- filename only for diagnostics local setter = data[name] if setter then - frozen = true -- don't permitoverload -- trace_initialize = true local data = setter.data if data then diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf Binary files differindex f76346da3..8aeaeaf09 100644 --- a/tex/context/interface/mkiv/i-context.pdf +++ b/tex/context/interface/mkiv/i-context.pdf diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf Binary files differindex ceb80af79..66f97e2ec 100644 --- a/tex/context/interface/mkiv/i-readme.pdf +++ b/tex/context/interface/mkiv/i-readme.pdf diff --git a/tex/context/modules/common/s-abbreviations-logos.tex b/tex/context/modules/common/s-abbreviations-logos.tex index c124a3a94..9cf7085f5 100644 --- a/tex/context/modules/common/s-abbreviations-logos.tex +++ b/tex/context/modules/common/s-abbreviations-logos.tex @@ -313,6 +313,7 @@ \logo [TUGBOAT] {Tug\-Boat} \logo [TUGNEWS] {Tug\-News} \logo [TYPEONE] {Type1} +\logo [TYPETHREE] {Type3} \logo [UCS] {ucs} \logo [UNICODE] {Uni\-code} \logo [UNIX] {Unix} diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index d9de24400..f23352419 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 09/29/19 14:34:09 +-- merge date : 10/01/19 10:36:53 do -- begin closure to overcome local limits and interference @@ -296,7 +296,7 @@ patterns.propername=(uppercase+lowercase+underscore)*(uppercase+lowercase+unders patterns.somecontent=(anything-newline-space)^1 patterns.beginline=#(1-newline) patterns.longtostring=Cs(whitespace^0/""*((patterns.quoted+nonwhitespace^1+whitespace^1/""*(endofstring+Cc(" ")))^0)) -function anywhere(pattern) +local function anywhere(pattern) return (1-P(pattern))^0*P(pattern) end lpeg.anywhere=anywhere @@ -19800,6 +19800,8 @@ function readers.cpal(f,fontdata,specification) fontdata.colorpalettes=palettes end end +local compress=gzip and gzip.compress +local compressed=compress and gzip.compressed function readers.svg(f,fontdata,specification) local tableoffset=gotodatatable(f,fontdata,"svg",specification.glyphs) if tableoffset then @@ -19821,10 +19823,14 @@ function readers.svg(f,fontdata,specification) for i=1,nofentries do local entry=entries[i] setposition(f,entry.offset) + local data=readstring(f,entry.length) + if compressed and not compressed(data) then + data=compress(data) + end entries[i]={ first=entry.first, last=entry.last, - data=readstring(f,entry.length) + data=data } end fontdata.svgshapes=entries |