Skip to content

Commit

Permalink
merge master via dev-0-1-0 with conflicts fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
gfngfn committed Oct 24, 2023
2 parents 1bf3543 + 7fe53a5 commit 04da70c
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 52 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`).
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README-ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* 株式会社ドワンゴ(2018年10月–2019年3月.アルバイトとして)
* [The SATySFi​book](https://booth.pm/ja/items/1127224)を購入頂いた,多くの匿名の支援者の方々

また,2023年5月現在も発展を続けています
また,2023年10月現在も発展を続けています

## Satyrographos を使ったインストール方法 (初心者向け)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions download-fonts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,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 "$PACKAGES"/font-latin-modern/font-latin-modern.0.0.1/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 "$PACKAGES"/font-latin-modern-math/font-latin-modern-math.0.0.1/fonts/

Expand Down
4 changes: 2 additions & 2 deletions satysfi.opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
opam-version: "2.0"
name: "satysfi"
version: "0.0.9"
version: "0.0.10"
maintainer: "Takashi Suwa"
authors: [
"Takashi Suwa"
Expand Down Expand Up @@ -31,7 +31,7 @@ depends: [
"dune" {build}
"menhir"
"ocamlfind" {build}
"otfed" {= "0.1.0"}
"otfed" {= "0.3.1"}
"ppx_deriving"
"re" {build}
"uutf"
Expand Down
16 changes: 2 additions & 14 deletions src/backend/fontFormat.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1189,18 +1189,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;
Expand Down Expand Up @@ -1316,7 +1304,7 @@ let get_cmap_subtable ~(file_path : abs_path) (d : D.source) : V.Cmap.subtable o
let* opt =
begin
D.Cmap.get d >>= fun icmap ->
D.Cmap.get_subtables icmap >>= fun isubtbls ->
D.Cmap.get_subtables icmap >>= fun (isubtbls, _ivarsubtbls) ->
isubtbls |> mapM (fun isubtbl ->
let format = D.Cmap.get_format_number isubtbl in
D.Cmap.unmarshal_subtable isubtbl >>= fun subtbl ->
Expand Down Expand Up @@ -1403,7 +1391,7 @@ let font_descriptor_of_decoder (dcdr : decoder) (font_name : string) : font_desc
font_name = font_name; (* PostScript name *)
font_family = ""; (* TODO: get this 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; (* TODO: get this from decoder *)
font_bbox = bbox;
italic_angle = 0.; (* TODO: get this from decoder; 'post.italicAngle' *)
Expand Down
54 changes: 24 additions & 30 deletions src/backend/tabular.ml
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,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 =
Expand Down Expand Up @@ -118,21 +115,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 =
Expand Down
7 changes: 7 additions & 0 deletions src/frontend/logging.ml
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,10 @@ let report_canonicalized_url ~(url : string) ~(canonicalized_url : string) ~(has
Printf.printf " registry URL: '%s'\n" url;
Printf.printf " canonicalized: '%s'\n" canonicalized_url;
Printf.printf " hash value: '%s'\n" hash_value

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"
4 changes: 4 additions & 0 deletions src/frontend/logging.mli
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,7 @@ val lock_cache_exists : lock_name -> abs_path -> unit
val downloading_lock : lock_name -> abs_path -> unit

val report_canonicalized_url : url:string -> canonicalized_url:string -> hash_value:registry_hash_value -> unit

val warn_wide_column_cell_overrides_nonempty_cell : unit -> unit

val warn_wide_row_cell_overrides_nonempty_cell : unit -> unit

0 comments on commit 04da70c

Please sign in to comment.