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

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

Original Pull Request: https://github.com/CCExtractor/ccextractor/pull/877

State: closed
Merged: Yes


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

**Original Pull Request:** https://github.com/CCExtractor/ccextractor/pull/877 **State:** closed **Merged:** Yes --- 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**
claunia added the pull-request label 2026-01-29 17:18:10 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#1720