Add Freetype font support to PutText() #1200
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is an update to #873 which adds Freetype font support to
PutText()
.The original work was done by @lz1998 back in 2021 but the PR has became stale due to build issues with freetype fonts on Windows. I have modified the original PR to limit building to Linux only as the build issues on Windows should not block this important feature which supports text for non ascii characters.
This PR stops the need for workarounds as discussed in #749 to support Chinese text or at #1150.
Merging of this PR should close off #873 and #874.
Windows
OpenCV may have now fixed the build issues on Windows here microsoft/vcpkg#27343 so any Windows users who require this feature can confirm that and submit another PR.
To remove the Linux only build restrictions.
contrib/freetype.cpp
and remove the#ifndef _WIN32
at the top of the file and#endif // _WIN32
at the bottom.contrib/freetype.go
andcontrib/freetype_test.go
files and remove the Go build tag//go:build linux
at the top of each file.