From ea985d61a4232b8c104a501b153ef6b6eb4b74d6 Mon Sep 17 00:00:00 2001 From: Akihisa Yagi Date: Wed, 12 Jul 2023 15:20:22 +0900 Subject: [PATCH 1/5] update URLs to Latin Modern fonts --- download-fonts.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/download-fonts.sh b/download-fonts.sh index 9435212bf..50f3e974f 100755 --- a/download-fonts.sh +++ b/download-fonts.sh @@ -46,12 +46,12 @@ download_file () { # Latin Modern NAME=lm2.004otf -download_file "$NAME.zip" "http://www.gust.org.pl/projects/e-foundry/latin-modern/download/lm2.004otf.zip" +download_file "$NAME.zip" "https://www.gust.org.pl/projects/e-foundry/latin-modern/download/lm2.004otf.zip" unzip -o "$CACHE/$NAME.zip" "*.otf" -d lib-satysfi/dist/fonts/ # Latin Modern Math NAME=latinmodern-math-1959 -download_file "$NAME.zip" "http://www.gust.org.pl/projects/e-foundry/lm-math/download/latinmodern-math-1959.zip" +download_file "$NAME.zip" "https://www.gust.org.pl/projects/e-foundry/lm-math/download/latinmodern-math-1959.zip" unzip -o "$CACHE/$NAME.zip" "*.otf" -d "$CACHE/" cp "$CACHE"/latinmodern-math-1959/otf/latinmodern-math.otf lib-satysfi/dist/fonts/ From 7a79d2387bacaf31827521f9117b03100761678f Mon Sep 17 00:00:00 2001 From: Takashi Suwa Date: Sun, 1 Oct 2023 04:01:41 +0900 Subject: [PATCH 2/5] update `otfed` to `0.3.0` --- satysfi.opam | 2 +- src/backend/fontFormat.ml | 16 ++-------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/satysfi.opam b/satysfi.opam index d32db85af..63a2dabdb 100644 --- a/satysfi.opam +++ b/satysfi.opam @@ -29,7 +29,7 @@ depends: [ "dune" {build} "menhir" "ocamlfind" {build} - "otfed" {= "0.1.0"} + "otfed" {= "0.3.0"} "ppx_deriving" "re" {build} "uutf" diff --git a/src/backend/fontFormat.ml b/src/backend/fontFormat.ml index e3610fa9f..597a4f3fc 100644 --- a/src/backend/fontFormat.ml +++ b/src/backend/fontFormat.ml @@ -1261,18 +1261,6 @@ let font_stretch_of_width_class = function | V.Os2.WidthUltraExpanded -> UltraExpandedStretch -let font_weight_of_weight_class = function - | V.Os2.WeightThin -> 100 - | V.Os2.WeightExtraLight -> 200 - | V.Os2.WeightLight -> 300 - | V.Os2.WeightNormal -> 400 - | V.Os2.WeightMedium -> 500 - | V.Os2.WeightSemiBold -> 600 - | V.Os2.WeightBold -> 700 - | V.Os2.WeightExtraBold -> 800 - | V.Os2.WeightBlack -> 900 - - type font_descriptor = { font_name : string; font_family : string; @@ -1389,7 +1377,7 @@ let get_cmap_subtable srcpath (d : D.source) : V.Cmap.subtable = let res = let open ResultMonad in D.Cmap.get d >>= fun icmap -> - D.Cmap.get_subtables icmap >>= fun isubtbls -> + D.Cmap.get_subtables icmap >>= fun (isubtbls, _ivarsubtbls) -> isubtbls |> List.fold_left (fun res isubtbl -> (* TODO: refactor here by using `mapM` *) res >>= fun acc -> let format = D.Cmap.get_format_number isubtbl in @@ -1477,7 +1465,7 @@ let font_descriptor_of_decoder (dcdr : decoder) (font_name : string) = font_name = font_name; (* -- same as Otfm.postscript_name dcdr -- *) font_family = ""; (* temporary; should be gotten from decoder *) font_stretch = Some(font_stretch_of_width_class ios2.I.Os2.value.us_width_class); - font_weight = Some(font_weight_of_weight_class ios2.I.Os2.value.us_weight_class); + font_weight = Some(ios2.I.Os2.value.us_weight_class); flags = None; (* temporary; should be gotten from decoder *) font_bbox = bbox; italic_angle = 0.; (* temporary; should be gotten from decoder; 'post.italicAngle' *) From 49cc0a92ef49e3f5fac0343fea993681dcc309d8 Mon Sep 17 00:00:00 2001 From: Takashi Suwa Date: Sun, 1 Oct 2023 16:57:44 +0900 Subject: [PATCH 3/5] upgrade `otfed` to `0.3.1` --- satysfi.opam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/satysfi.opam b/satysfi.opam index 63a2dabdb..bc5612f7d 100644 --- a/satysfi.opam +++ b/satysfi.opam @@ -29,7 +29,7 @@ depends: [ "dune" {build} "menhir" "ocamlfind" {build} - "otfed" {= "0.3.0"} + "otfed" {= "0.3.1"} "ppx_deriving" "re" {build} "uutf" From 01db5e65bfeca35dd2d3f83dc48f4939af420c86 Mon Sep 17 00:00:00 2001 From: Takashi Suwa Date: Sun, 1 Oct 2023 21:37:07 +0900 Subject: [PATCH 4/5] warn overriding of non-empty tabular cells instead of aborting --- src/backend/tabular.ml | 54 ++++++++++++++++++----------------------- src/frontend/logging.ml | 8 ++++++ 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/src/backend/tabular.ml b/src/backend/tabular.ml index 42480e373..8606d30e5 100644 --- a/src/backend/tabular.ml +++ b/src/backend/tabular.ml @@ -49,21 +49,18 @@ let determine_row_metrics (restprev : rest_row) (row : row) : rest_row * length | ((Some((numrow, len)) as rsome) :: rtail, cell :: ctail) -> begin match cell with - | NormalCell(_) - | MultiCell(_, _, _, _) - -> assert false (* temporary; maybe should just warn users *) - - | EmptyCell -> - let (hgtmaxnew, dptminnew) = - if numrow < 1 then - assert false - else if numrow = 1 then - (hgtmax, dptmin) (* temporary; should consider 'len' *) - else - (hgtmax, dptmin) - in - aux (Alist.extend restacc rsome) hgtmaxnew dptminnew rtail ctail - end + | NormalCell(_) | MultiCell(_, _, _, _) -> Logging.warn_wide_row_cell_overrides_nonempty_cell () + | EmptyCell -> () + end; + let (hgtmaxnew, dptminnew) = + if numrow < 1 then + assert false + else if numrow = 1 then + (hgtmax, dptmin) (* temporary; should consider 'len' *) + else + (hgtmax, dptmin) + in + aux (Alist.extend restacc rsome) hgtmaxnew dptminnew rtail ctail in let (restacc, hgtmax, dptmin) = aux Alist.empty Length.zero Length.zero restprev row in let rest = @@ -119,21 +116,18 @@ let determine_column_width (restprev : rest_column) (col : column) : rest_column | ((Some((numcol, widrest)) as rsome) :: rtail, cell :: ctail) -> begin match cell with - | NormalCell(_) - | MultiCell(_) - -> assert false (* temporary; maybe should just warn users *) - - | EmptyCell -> - let widmaxnew = - if numcol < 1 then - assert false - else if numcol = 1 then - Length.max widrest widmax - else - widmax - in - aux (Alist.extend restacc rsome) widmaxnew rtail ctail - end + | NormalCell(_) | MultiCell(_) -> Logging.warn_wide_column_cell_overrides_nonempty_cell () + | EmptyCell -> () + end; (* TODO: detailed warning *) + let widmaxnew = + if numcol < 1 then + assert false + else if numcol = 1 then + Length.max widrest widmax + else + widmax + in + aux (Alist.extend restacc rsome) widmaxnew rtail ctail in let (restacc, widmax) = aux Alist.empty Length.zero restprev col in let rest = diff --git a/src/frontend/logging.ml b/src/frontend/logging.ml index 23e80e429..bb30ad3b7 100644 --- a/src/frontend/logging.ml +++ b/src/frontend/logging.ml @@ -195,3 +195,11 @@ let warn_underfull_line (pageno : int) = let warn_unreachable (pageno : int) = Format.printf " [Warning] a line unable to be broken into a paragraph occurs on page %d\n" pageno + + +let warn_wide_column_cell_overrides_nonempty_cell () = + Format.printf " [Warning] a non-empty cell was overridden by a cell that has more than one column span.\n" + + +let warn_wide_row_cell_overrides_nonempty_cell () = + Format.printf " [Warning] a non-empty cell was overridden by a cell that has more than one row span.\n" From 9cac537aa7e94725d45d05dde4a33458abb6b188 Mon Sep 17 00:00:00 2001 From: Takashi Suwa Date: Sun, 22 Oct 2023 16:45:13 +0900 Subject: [PATCH 5/5] release SATySFi 0.0.10 --- CHANGELOG.md | 11 +++++++++-- README-ja.md | 2 +- README.md | 2 +- satysfi.opam | 2 +- src/frontend/main.ml | 2 +- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ee05651a..5a7c77bc0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/), ## [Unreleased] +## [0.0.10] - 2023-10-12 +### Fixed +- Fix URLs of Latin Modern fonts for installation ([PR\#412](https://github.com/gfngfn/SATySFi/pull/412) by `caphosra`). +- Several fixes about decoding/encoding OpenType fonts ([PR\#415](https://github.com/gfngfn/SATySFi/pull/415)). +- Warn overriding of non-empty tabular cells instead of aborting ([PR\#416](https://github.com/gfngfn/SATySFi/pull/416)). + ## [0.0.9] - 2023-05-26 ### Fixed - Emit a parsing error when a parameter sequence ends with an optional one ([PR\#365](https://github.com/gfngfn/SATySFi/pull/365) by `anko9801`). @@ -147,8 +153,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/), - Initial version of SATySFi - [Unreleased]: https://github.com/gfngfn/SATySFi/compare/v0.0.9...HEAD - [0.0.8]: https://github.com/gfngfn/SATySFi/compare/v0.0.8...v0.0.9 + [Unreleased]: https://github.com/gfngfn/SATySFi/compare/v0.0.10...HEAD + [0.0.10]: https://github.com/gfngfn/SATySFi/compare/v0.0.9...v0.0.10 + [0.0.9]: https://github.com/gfngfn/SATySFi/compare/v0.0.8...v0.0.9 [0.0.8]: https://github.com/gfngfn/SATySFi/compare/v0.0.7...v0.0.8 [0.0.7]: https://github.com/gfngfn/SATySFi/compare/v0.0.6...v0.0.7 [0.0.6]: https://github.com/gfngfn/SATySFi/compare/v0.0.5...v0.0.6 diff --git a/README-ja.md b/README-ja.md index bca88edb6..de971f320 100644 --- a/README-ja.md +++ b/README-ja.md @@ -14,7 +14,7 @@ * 株式会社ドワンゴ(2018年10月–2019年3月.アルバイトとして) * [The SATySFi​book](https://booth.pm/ja/items/1127224)を購入頂いた,多くの匿名の支援者の方々 -また,2023年5月現在も発展を続けています。 +また,2023年10月現在も発展を続けています。 ## Satyrographos を使ったインストール方法 (初心者向け) diff --git a/README.md b/README.md index 6740508bd..a9f0b5dd0 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ This software was supported by: * Dwango Co., Ltd. (October 2018 – March 2019; as a part-time job), and * many anonymous supporters who bought [The SATySFi​book](https://booth.pm/ja/items/1127224), -and its development continues to this day (May 2023). +and its development continues to this day (Oct 2023). ## Install using Satyrographos (for non-devs) diff --git a/satysfi.opam b/satysfi.opam index bc5612f7d..a1edd7172 100644 --- a/satysfi.opam +++ b/satysfi.opam @@ -1,6 +1,6 @@ opam-version: "2.0" name: "satysfi" -version: "0.0.9" +version: "0.0.10" maintainer: "Takashi Suwa" authors: [ "Takashi Suwa" diff --git a/src/frontend/main.ml b/src/frontend/main.ml index 749661668..8143e9641 100644 --- a/src/frontend/main.ml +++ b/src/frontend/main.ml @@ -1006,7 +1006,7 @@ let error_log_environment suspended = let arg_version () = print_string ( - " SATySFi version 0.0.9\n" + " SATySFi version 0.0.10\n" (* ^ " (in the middle of the transition from Macrodown)\n" ^ " ____ ____ ________ _____ ______\n"