[PR #877] [MERGED] [FEATURE] FreeType-based text renderer (-out=spupng with teletext/EIA608) #1717

Open
opened 2026-01-29 17:18:09 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/877
Author: @harrynull
Created: 1/5/2018
Status: Merged
Merged: 1/9/2018
Merged by: @cfsmp3

Base: masterHead: text-renderer


📝 Commits (8)

  • 8037a09 Implementation of text renderer
  • 0a3dd03 Fix some characters being cut
  • 1a1f7d1 Fix encoding and other bugs
  • e4739b0 Add black background & fix bugs
  • 03c99b9 Fix more bugs
  • 159a6f4 Change to relative path
  • 8848a55 Add a font option & Default font for MacOS & Fix anti-aliasing
  • 79d1355 Document -font & enlarge default canvas

📊 Changes

23 files changed (+1321 additions, -1003 deletions)

View changed files

📝 linux/Makefile.am (+44 -7)
📝 linux/build (+44 -3)
📝 linux/build_hardsubx (+44 -3)
📝 linux/builddebug (+44 -3)
📝 mac/Makefile.am (+44 -6)
📝 mac/build.command (+44 -4)
📝 src/CMakeLists.txt (+47 -3)
📝 src/ccextractor.c (+0 -1)
📝 src/lib_ccx/ccx_common_option.h (+3 -0)
📝 src/lib_ccx/ccx_encoders_common.c (+0 -2)
📝 src/lib_ccx/ccx_encoders_common.h (+5 -0)
📝 src/lib_ccx/ccx_encoders_curl.c (+0 -2)
📝 src/lib_ccx/ccx_encoders_sami.c (+0 -1)
📝 src/lib_ccx/ccx_encoders_smptett.c (+0 -1)
📝 src/lib_ccx/ccx_encoders_spupng.c (+772 -277)
src/lib_ccx/ccx_encoders_spupng.h (+0 -10)
📝 src/lib_ccx/ccx_encoders_transcript.c (+0 -2)
📝 src/lib_ccx/ocr.c (+0 -1)
📝 src/lib_ccx/params.c (+19 -1)
src/lib_ccx/spupng_encoder.c (+0 -599)

...and 3 more files

📄 Description

Please prefix your pull request with one of the following: [FEATURE] [FIX] [IMPROVEMENT].

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.

My familiarity with the project is as follows (check one):

  • I have never used CCExtractor.
  • I have used CCExtractor just a couple of times.
  • I absolutely love CCExtractor, but have not contributed previously.
  • I am an active contributor to CCExtractor.

ABSTRACT
The pull request implements a FreeType-based text renderer, which can be used to generate the bitmaps for spupng in the case of teletext/EIA608.

CHANGES

  • Remove "ccx_encoders_spupng.h" (The old implementation of it) and "spupng_encoder.h" (encoders don't usually have header files)
  • Rename "spupng_encoder.c" to "ccx_encoders_spupng.c" (For consistency).
  • Add new implementation based on FreeType to "ccx_encoders_spupng.c".
  • Add a lot comments/document to the code.

KNOWN ISSUES
Note that the issues will also affect EIA-608 which may not have these issues before (But the new implementation is generally much cleaner, easier to maintain and more extensible and customizable than the old one).

  • Font needs to be manually set. FIXED (New option -font added to specify font)
  • No color: tag is rendered as-is.
  • XML position may be not correct.
  • Characters like "$" will be cut. FIXED
  • Accented letters don't render. (could be encoding problem) FIXED

NOTE
Please merge this PR after #876 , or it won't compile.

EXAMPLES
Note that the preview is not latest. Please refer to comments for the latest preview.
sub0001
Example of a good output.

sub0060
Example of tag rendered as-is.

![sub0000](https://user-images.githubusercontent.com/7413706/34639001-3e7d4ae2-f312-11e7-806b-b92c4d739b7b.png) (original generated png file) ![sub0000](https://user-images.githubusercontent.com/7413706/34639115-71ab680c-f314-11e7-8c70-5f75801d7dbe.jpg) (transparency is replaced by black) Example of "$" being cut.

FIXED


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/CCExtractor/ccextractor/pull/877 **Author:** [@harrynull](https://github.com/harrynull) **Created:** 1/5/2018 **Status:** ✅ Merged **Merged:** 1/9/2018 **Merged by:** [@cfsmp3](https://github.com/cfsmp3) **Base:** `master` ← **Head:** `text-renderer` --- ### 📝 Commits (8) - [`8037a09`](https://github.com/CCExtractor/ccextractor/commit/8037a0942f4e5bd6c2b10179afa857bf4c887360) Implementation of text renderer - [`0a3dd03`](https://github.com/CCExtractor/ccextractor/commit/0a3dd03f11908bfb860ca380207e4b14ec36c2ac) Fix some characters being cut - [`1a1f7d1`](https://github.com/CCExtractor/ccextractor/commit/1a1f7d1a9e168065bee138e96a0018d63bb1291d) Fix encoding and other bugs - [`e4739b0`](https://github.com/CCExtractor/ccextractor/commit/e4739b0d1d1b479ff0906a6abd982b2347eaa2c7) Add black background & fix bugs - [`03c99b9`](https://github.com/CCExtractor/ccextractor/commit/03c99b9b5cb6043bc5eaf210fa5a2bb2954c93db) Fix more bugs - [`159a6f4`](https://github.com/CCExtractor/ccextractor/commit/159a6f4c9eba76eeae16da12e89cf1825fddeb90) Change to relative path - [`8848a55`](https://github.com/CCExtractor/ccextractor/commit/8848a55531f897e67d89a00b2eaed1ef674eb7fd) Add a font option & Default font for MacOS & Fix anti-aliasing - [`79d1355`](https://github.com/CCExtractor/ccextractor/commit/79d1355a404b545c122eb65a0f94e80526b61f71) Document -font & enlarge default canvas ### 📊 Changes **23 files changed** (+1321 additions, -1003 deletions) <details> <summary>View changed files</summary> 📝 `linux/Makefile.am` (+44 -7) 📝 `linux/build` (+44 -3) 📝 `linux/build_hardsubx` (+44 -3) 📝 `linux/builddebug` (+44 -3) 📝 `mac/Makefile.am` (+44 -6) 📝 `mac/build.command` (+44 -4) 📝 `src/CMakeLists.txt` (+47 -3) 📝 `src/ccextractor.c` (+0 -1) 📝 `src/lib_ccx/ccx_common_option.h` (+3 -0) 📝 `src/lib_ccx/ccx_encoders_common.c` (+0 -2) 📝 `src/lib_ccx/ccx_encoders_common.h` (+5 -0) 📝 `src/lib_ccx/ccx_encoders_curl.c` (+0 -2) 📝 `src/lib_ccx/ccx_encoders_sami.c` (+0 -1) 📝 `src/lib_ccx/ccx_encoders_smptett.c` (+0 -1) 📝 `src/lib_ccx/ccx_encoders_spupng.c` (+772 -277) ➖ `src/lib_ccx/ccx_encoders_spupng.h` (+0 -10) 📝 `src/lib_ccx/ccx_encoders_transcript.c` (+0 -2) 📝 `src/lib_ccx/ocr.c` (+0 -1) 📝 `src/lib_ccx/params.c` (+19 -1) ➖ `src/lib_ccx/spupng_encoder.c` (+0 -599) _...and 3 more files_ </details> ### 📄 Description Please prefix your pull request with one of the following: **[FEATURE]** **[FIX]** **[IMPROVEMENT]**. **In raising this pull request, I confirm the following (please check boxes):** - [X] I have read and understood the [contributors guide](https://github.com/CCExtractor/ccextractor/blob/master/.github/CONTRIBUTING.md). - [X] I have checked that another pull request for this purpose does not exist. - [X] I have considered, and confirmed that this submission will be valuable to others. - [X] I accept that this submission may not be used, and the pull request closed at the will of the maintainer. - [X] I give this submission freely, and claim no ownership to its content. **My familiarity with the project is as follows (check one):** - [ ] I have never used CCExtractor. - [ ] I have used CCExtractor just a couple of times. - [ ] I absolutely love CCExtractor, but have not contributed previously. - [X] I am an active contributor to CCExtractor. --- **ABSTRACT** The pull request implements a FreeType-based text renderer, which can be used to generate the bitmaps for spupng in the case of teletext/EIA608. **CHANGES** - Remove "ccx_encoders_spupng.h" (The old implementation of it) and "spupng_encoder.h" (encoders don't usually have header files) - Rename "spupng_encoder.c" to "ccx_encoders_spupng.c" (For consistency). - Add new implementation based on FreeType to "ccx_encoders_spupng.c". - Add a lot comments/document to the code. **KNOWN ISSUES** **Note that the issues will also affect EIA-608 which may not have these issues before** (But the new implementation is generally much cleaner, easier to maintain and more extensible and customizable than the old one). - <del> Font needs to be manually set.</del> **FIXED** (New option -font added to specify font) - No color: <font> tag is rendered as-is. - XML position may be not correct. - <del>Characters like "$" will be cut.</del> **FIXED** - <del>Accented letters don't render. (could be encoding problem)</del> **FIXED** **NOTE** Please merge this PR after #876 , or it won't compile. **EXAMPLES** **Note that the preview is not latest. Please refer to comments for the latest preview.** ![sub0001](https://user-images.githubusercontent.com/7413706/34649413-be139824-f3e9-11e7-9779-7fbcb7293f06.png) Example of a good output. ![sub0060](https://user-images.githubusercontent.com/7413706/34649418-d03fbd34-f3e9-11e7-82e2-5e7ab617f644.png) Example of tag rendered as-is. <del> ![sub0000](https://user-images.githubusercontent.com/7413706/34639001-3e7d4ae2-f312-11e7-806b-b92c4d739b7b.png) (original generated png file) ![sub0000](https://user-images.githubusercontent.com/7413706/34639115-71ab680c-f314-11e7-8c70-5f75801d7dbe.jpg) (transparency is replaced by black) Example of "$" being cut. </del> **FIXED** --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 17:18:09 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#1717