Added font name aliases for Arial, Courier New and Times New Roman (#790)

* Fix `unknown` fontname in TrueType(Arial, TimesNewRoman) (#767)

* Add changelog

* Cleanup CHANGELOG.md

* Add comment with source of alias names

Co-authored-by: thirakawa <ewjohnp@gmail.com>
Co-authored-by: Pieter Marsman <pietermarsman@gmail.com>
pull/793/head
sobuen 2022-08-14 19:12:02 +09:00 committed by GitHub
parent 77df431871
commit ca9f75a032
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 2 deletions

View File

@ -5,15 +5,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased] ## [Unreleased]
### Added
- Output converter for the hOCR format ([#651](https://github.com/pdfminer/pdfminer.six/pull/651)) - Output converter for the hOCR format ([#651](https://github.com/pdfminer/pdfminer.six/pull/651))
- Font name aliases for Arial, Courier New and Times New Roman ([#790](https://github.com/pdfminer/pdfminer.six/pull/790))
### Fixed ### Fixed
- 'ValueError': when bmp images with 1 bit channel are decoded ([#773](https://github.com/pdfminer/pdfminer.six/issues/773)) - `ValueError` when bmp images with 1 bit channel are decoded ([#773](https://github.com/pdfminer/pdfminer.six/issues/773))
- `ValueError` when trying to decrypt empty metadata values ([#766](https://github.com/pdfminer/pdfminer.six/issues/766)) - `ValueError` when trying to decrypt empty metadata values ([#766](https://github.com/pdfminer/pdfminer.six/issues/766))
- Sphinx errors during building of documentation ([#760](https://github.com/pdfminer/pdfminer.six/pull/760)) - Sphinx errors during building of documentation ([#760](https://github.com/pdfminer/pdfminer.six/pull/760))
- `TypeError` when getting default width of font ([#720](https://github.com/pdfminer/pdfminer.six/issues/720)) - `TypeError` when getting default width of font ([#720](https://github.com/pdfminer/pdfminer.six/issues/720))
- Install typing-extensions on Python 3.6 and 3.7 ([#775](https://github.com/pdfminer/pdfminer.six/pull/775)) - Installing typing-extensions on Python 3.6 and 3.7 ([#775](https://github.com/pdfminer/pdfminer.six/pull/775))
- `TypeError` in cmapdb.py when parsing null characters ([#768](https://github.com/pdfminer/pdfminer.six/pull/768)) - `TypeError` in cmapdb.py when parsing null characters ([#768](https://github.com/pdfminer/pdfminer.six/pull/768))
### Deprecated ### Deprecated

View File

@ -4447,3 +4447,18 @@ FONT_METRICS = {
}, },
), ),
} }
# Aliases defined in implementation note 62 in Appecix H. related to section 5.5.1
# (Type 1 Fonts) in the PDF Reference.
FONT_METRICS["Arial"] = FONT_METRICS["Helvetica"]
FONT_METRICS["Arial,Italic"] = FONT_METRICS["Helvetica-Oblique"]
FONT_METRICS["Arial,Bold"] = FONT_METRICS["Helvetica-Bold"]
FONT_METRICS["Arial,BoldItalic"] = FONT_METRICS["Helvetica-BoldOblique"]
FONT_METRICS["CourierNew"] = FONT_METRICS["Courier"]
FONT_METRICS["CourierNew,Italic"] = FONT_METRICS["Courier-Oblique"]
FONT_METRICS["CourierNew,Bold"] = FONT_METRICS["Courier-Bold"]
FONT_METRICS["CourierNew,BoldItalic"] = FONT_METRICS["Courier-BoldOblique"]
FONT_METRICS["TimesNewRoman"] = FONT_METRICS["Times-Roman"]
FONT_METRICS["TimesNewRoman,Italic"] = FONT_METRICS["Times-Italic"]
FONT_METRICS["TimesNewRoman,Bold"] = FONT_METRICS["Times-Bold"]
FONT_METRICS["TimesNewRoman,BoldItalic"] = FONT_METRICS["Times-BoldItalic"]