Metadata-Version: 2.1
Name: fontquery
Version: 1.13
Summary: Query a font in Fedora release
Author-email: Akira TAGOH <akira@tagoh.org>
License: MIT License
        
        Copyright (c) 2022 Red Hat, Inc.
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/fedora-i18n/fontquery
Project-URL: Bug Tracker, https://github.com/fedora-i18n/fontquery/issues
Keywords: fedora,fonts
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: markdown
Requires-Dist: langtable
Requires-Dist: pyxdg
Requires-Dist: termcolor

# Fontquery
[![pip version badge](https://img.shields.io/pypi/v/fontquery)](https://pypi.org/project/fontquery/)
[![tag badge](https://img.shields.io/github/v/tag/fedora-i18n/fontquery)](https://github.com/fedora-i18n/fontquery/tags)
[![license badge](https://img.shields.io/github/license/fedora-i18n/fontquery)](./LICENSE)

fontquery is a tool to query fonts in the certain Fedora release.

## How to install

``` shell
$ pip3 install fontquery
```

Or in Fedora,

``` shell
# dnf install fontquery
```

## How to install from git

``` shell
$ pip3 install --user build wheel
$ python3 -m build
$ pip3 install --user dist/fontquery*.whl
```

Or in Fedora,

``` shell
# dnf install python3-build python3-wheel
$ python3 -m build
$ pip3 install --user dist/fontquery*.whl
```

## Usage

```
usage: fontquery [-h] [-C] [--disable-cache] [-f FILENAME_FORMAT] [-r RELEASE] [-l LANG]
                 [-m {fcmatch,fclist,json,html}] [-O OUTPUT_DIR] [-t {minimal,extra,all}] [-T TITLE] [-v] [-V]
                 [args ...]

Query fonts

positional arguments:
  args                  Queries (default: None)

options:
  -h, --help            show this help message and exit
  -C, --clean-cache     Clean caches before processing (default: False)
  --disable-cache       Enforce processing everything even if not updating (default: False)
  -f FILENAME_FORMAT, --filename-format FILENAME_FORMAT
                        Output filename format. only take effects with --mode=html (default:
                        {platform}-{release}-{target}.{mode})
  -r RELEASE, --release RELEASE
                        Release number such as "rawhide" and "39". "local" to query from current environment
                        instead of images (default: ['local'])
  -l LANG, --lang LANG  Language list to dump fonts data into JSON (default: None)
  -m {fcmatch,fclist,json,html}, --mode {fcmatch,fclist,json,html}
                        Action to perform for query (default: fcmatch)
  -O OUTPUT_DIR, --output-dir OUTPUT_DIR
                        Output directory (default: .)
  -t {minimal,extra,all}, --target {minimal,extra,all}
                        Query fonts from (default: minimal)
  -T TITLE, --title TITLE
                        Page title format. only take effects with --mode=html (default: {platform} {release}:
                        {target})
  -v, --verbose         Show more detailed logs (default: 0)
  -V, --version         Show version (default: False)
```

To query sans-serif for Hindi on Fedora 36,

``` shell
$ fontquery -r 36 sans-serif:lang=hi
Lohit-Devanagari.ttf: "Lohit Devanagari" "Regular"
```

To generate JSON from langpacks installed environment:

``` shell
$ fontquery -m json -t langpacks
...
```

To generate html table:

``` shell
$ fontquery -m json -t langpacks | fq2html -o langpacks.html -
```

Or simply

``` shell
$ fontquery -m html -t langpacks -r 40
```

To check difference between local and reference:

``` shell
$ fontquery-diff -R text rawhide local
```

## For developers

Before committing something into git repository, you may want to do:

``` shell
$ git config core.hooksPath hooks
```

to make sure our hook scripts works.
