Merge pull request #2776 from Kumataro:master_freetype2_doc
freetype2: Fix comments in freetype.hpp and README.md * freetype2: Update README.md * freetype2: Update freetype.hpp * freetype2: remove new blank line * Update README.md - Remove dots from the Headers - Align number of === / --- symbols on the next line * freetype: remove comment for color.pull/2782/head
parent
9d32f0c83b
commit
9b5a801148
2 changed files with 24 additions and 24 deletions
@ -1,34 +1,34 @@ |
||||
FreeType Module |
||||
=========== |
||||
FreeType2 Wrapper Module |
||||
======================== |
||||
|
||||
This FreeType module allows you to draw strings with outlines and bitmaps. |
||||
This FreeType2 wrapper module allows to draw strings with outlines and bitmaps. |
||||
|
||||
Requested external libraries |
||||
---------------------------- |
||||
|
||||
Installation |
||||
----------- |
||||
harfbuzz is requested to convert UTF8 to gid(GlyphID). |
||||
|
||||
freetype library is requested to rasterize given gid. |
||||
|
||||
harfbuzz https://www.freedesktop.org/wiki/Software/HarfBuzz/ |
||||
freetype https://www.freetype.org/ |
||||
- harfbuzz https://www.freedesktop.org/wiki/Software/HarfBuzz/ |
||||
- freetype https://www.freetype.org/ |
||||
|
||||
Usage |
||||
----------- |
||||
cv::freetype::FreeType2 ft2; |
||||
ft2.loadFontData("your-font.ttf", 0); |
||||
ft2.setSplitNumber( 4 ); // Bezier-line is splited by 4 segment. |
||||
ft2.putText(src, .... ) |
||||
----- |
||||
|
||||
``` |
||||
cv::Ptr<cv::freetype::FreeType2> ft2; |
||||
ft2 = cv::freetype::createFreeType2(); |
||||
ft2->loadFontData(ttf_pathname, 0); |
||||
ft2->putText(mat, "hello world", cv::Point(20, 200), |
||||
30, CV_RGB(0, 0, 0), cv::FILLED, cv::LINE_AA, true); |
||||
``` |
||||
|
||||
Option |
||||
------------ |
||||
------ |
||||
- 2nd argument of loadFontData is used if font file has many font data. |
||||
- 3 drawing mode is available. |
||||
-- outline mode is used if lineWidth is larger than 0. (like original putText) |
||||
-- bitmap mode is used if lineWidth is less than 0. |
||||
--- 1bit bitmap mode is used if lineStyle is 4 or 8. |
||||
--- gray bitmap mode is used if lineStyle is 16. |
||||
|
||||
Future work |
||||
------------ |
||||
- test |
||||
-- CJK and ... |
||||
- RTL,LTR,TTB,BTT... |
||||
- outline mode is used if lineWidth is larger than 0. (like original putText) |
||||
- bitmap mode is used if lineWidth is less than 0. |
||||
- 1bit bitmap mode is used if lineStyle is 4 or 8. |
||||
- gray bitmap mode is used if lineStyle is 16. |
||||
|
Loading…
Reference in new issue