Skip to content

Commit

Permalink
introduce man page ots-sanitize.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gagath committed Dec 2, 2020
1 parent 1468330 commit d4e981d
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
42 changes: 42 additions & 0 deletions docs/ots-sanitize.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.TH OTS-SANITIZE "1" "November 2020" "OpenType Sanitizer" "User Commands"
.SH NAME
ots-sanitize \- font validator and transcoder
.SH SYNOPSIS
.B yes
[\fI\,OPTIONS\/\fR]... \fI\,FONT_FILE\/\fR [\fI\,DEST_FONT_FILE\/\fR] [\fI\,FONT_INDEX\/\fR]
.SH DESCRIPTION
.\" Add any additional description here
.PP
ots-sanitize is a program which validates and/or transcodes a font file using
the OTS library.
.PP
The OpenType Sanitizer (OTS) parses and serializes OpenType files (OTF, TTF)
and WOFF and WOFF2 font files, validating them and sanitizing them as it goes.
.TP
\fB\-\-quiet\fR
do not display information or error messages
.TP
\fB\-\-version\fR
output version information and exit
.SH EXAMPLES
Sanitize a sample and save it to another file:
.PP
.RS
.nf
$ ots-sanitize sample.otf transcoded_sample.otf
File sanitized successfully!
.fi
.RE
.PP
Try to sanitize a malformed file:
.PP
.RS
.nf
$ ots-sanitize malformed.ttf
WARNING: bad range shift
ERROR at src/ots.cc:670 (ProcessGeneric)
Failed to sanitize file!
.RE
.fi
.SH "REPORTING BUGS"
Report bugs to <https://github.com/khaledhosny/ots/issues>

This comment has been minimized.

Copy link
@Alhadis

Alhadis Dec 16, 2020

Suggested edit:

.Dd November 2020
.Dt OTS-SANITIZE 1
.Os
.Sh NAME
.Nm ots-sanitize
.Nd font validator and transcoder
.
.Sh SYNOPSIS
.Nm
.	Op Fl -quiet
.	Ar    FONT_FILE
.	Op Ar DEST_FONT_FILE
.	Op Ar FONT_INDEX
.Nm
.	Fl -version
.
.Sh DESCRIPTION
.Nm
is a program which validates and/or transcodes a font file using the OTS library.
.Pp
The OpenType Sanitizer (OTS) parses and serializes OpenType files (OTF, TTF) \
and WOFF and WOFF2 font files, validating them and sanitizing them as it goes.
.
.Bl -tag -width 6n
.It Fl -quiet
Do not display information or error messages.
.It Fl -version
Output version information and exit.
.El
.
.Sh EXAMPLES
Sanitize a sample and save it to another file:
.Dl $ ots-sanitize sample.otf transcoded_sample.otf
.Bd -literal -offset \n[doc-display-indent]
File sanitized successfully!
.Ed
.
.Pp
Try to sanitize a malformed file:
.Dl $ ots-sanitize malformed.ttf
.Bd -literal -offset \n[doc-display-indent]
WARNING: bad range shift
ERROR at src/ots.cc:670 (ProcessGeneric)
Failed to sanitize file!
.Ed
.
.Sh BUGS
Report bugs to
.Lk https://github.com/khaledhosny/ots/issues .

This comment has been minimized.

Copy link
@khaledhosny

khaledhosny Dec 16, 2020

Owner

It is hard to see the difference like this, please open a pull request.

This comment has been minimized.

Copy link
@Alhadis

Alhadis Dec 16, 2020

It is hard to see the difference like this

Does this help?

Figure 1

Basically, I just rewrote the page to use the mdoc(7) macro package, rather than man(7). The latter is purely presentational; the former is a full-featured semantic DSL for manual pages.

Pre-formatted output

You can cat these to your terminal to see the result with ANSI escape codes:

This comment has been minimized.

Copy link
@khaledhosny

khaledhosny Dec 16, 2020

Owner

I need a diff to apply and comment on, in the form of a pull request.

This comment has been minimized.

Copy link
@Alhadis

Alhadis Dec 16, 2020

As you wish. See #231.

2 changes: 2 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ if cxx.has_header('sys/time.h')
endif


install_man('docs/ots-sanitize.1')

gtest = subproject('gtest').get_variable('gtest_main_dep')

cff_charstring = executable('cff_charstring',
Expand Down

0 comments on commit d4e981d

Please sign in to comment.