Zookeeper and FreeType Libraries

Source: Internet
Author: User

Linux, FreeBSD, and other open-source operating systems generally use FreeType to display text. Some software in windows, such as Foxit, also have FreeType.

The font_engine_freetype_int16 font_engine_freetype_int16 text engine of idea uses FreeType to obtain the model. In Windows, We must compile FreeType before using font_engine_freetype_int16:

  1. Download FreeType2 from www.freetype.org and unzip the latest freetype-2.3.9.
  2. Take vc2005 express as an example to directly compile FreeType. sln in/builds/Win32/vc2005. (But this version of FreeType. SLN is better. Open it in a text editor and change "10.00" next to "Microsoft Visual Studio solution file, format version 10.00" to "9.00)
  3. For other compilers, such as C ++ builder, directly install/docs/install. add the files listed in any to the project (however, it is really troublesome to add these files to the east and west. You can click here to download the FreeType2 library compilation project of C ++ builder ).
  4. Add the compiled library file (in/objs/Win32, pay attention to the compiled version) to the project, and set the include path to FreeType-2.3.9/include.
Using FreeType's source code:

Typedef Syntax: font_engine_freetype_int16 fe_type;
Typedef fe_type: path_adaptor_type vs_type;

Fe_type Fe;
If (! Fe. load_font ("C: // windows // fonts // simhei. TTF", 0, usage: glyph_ren_outline) return;
Fe. Height (36.0 );
Fe. flip_y (true );
Fe. hinting (true );

Wchar_t * s = l "C ++ programming ";
STD: vector <weight: int8u> data;
Vs_type;
Usage: conv_curve <vs_type> ccvs ();
Int x = 20, y = 100;
For (; * s; s ++)
{
If (! Fe. prepare_glyph (* s) continue;
Data. Resize (Fe. data_size ());
Fe. write_glyph_to (& Data [0]);
Vs. INIT (& Data [0], Data. Size (), x, y );
X + = Fe. advance_x ();
Y + = Fe. advance_y ();
RAS. add_path (ccvs );
Expiration: render_scanlines_aa_solid (Ras, SL, renb, placement: rgba (, 1 ));
}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.