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/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/ diff --git a/satysfi.opam b/satysfi.opam index d8d3307ca..0bcabdffe 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" @@ -30,7 +30,7 @@ depends: [ "dune" {build} "menhir" "ocamlfind" {build} - "otfed" {= "0.1.0"} + "otfed" {= "0.3.1"} "ppx_deriving" "re" {build} "uutf" diff --git a/src/backend/fontFormat.ml b/src/backend/fontFormat.ml index c95d878ca..2fd3a7fc6 100644 --- a/src/backend/fontFormat.ml +++ b/src/backend/fontFormat.ml @@ -1208,18 +1208,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; @@ -1336,7 +1324,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 @@ -1423,7 +1411,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' *) diff --git a/src/backend/tabular.ml b/src/backend/tabular.ml index f06822a28..3a4065494 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 3db45340f..d78d71a99 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"