⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vertical.sgml

📁 Pango is a library for layout and rendering of text, with an emphasis on internationalization. Pang
💻 SGML
字号:
<!-- ##### SECTION Title ##### -->Vertical Text<!-- ##### SECTION Short_Description ##### -->Laying text out in vertical directions<!-- ##### SECTION Long_Description ##### --><para>Since 1.16, Pango is able to correctly lay vertical text out.  In fact, it canset layouts of mixed vertical and non-vertical text.  This section describesthe types used for setting vertical text parameters.</para><para>The way this is implemented is through the concept of<firstterm>gravity</firstterm>.  Gravity of normal Latin text is south.  Agravity value of east means that glyphs will be rotated ninety degreescounterclockwise.  So, to render vertical text one needs to set the gravityand rotate the layout using the matrix machinery already in place.  This hasthe huge advantage that most algorithms working on a #PangoLayout do not needany change as the assumption that lines run in the X direction and stack inthe Y direction holds even for vertical text layouts.</para><para>Applications should only need to set base gravity on #PangoContext in use, andlet Pango decide the gravity assigned to each run of text.  This automaticallyhandles text with mixed scripts.  A very common use is to set the context basegravity to auto using pango_context_set_base_gravity()and rotate the layout normally.  Pango will make sure thatAsian languages take the right form, while other scripts are rotated normally.</para><para>The correct way to set gravity on a layout is to set it on the contextassociated with it using pango_context_set_base_gravity().  The contextof a layout can be accessed using pango_layout_get_context().  The currentlyset base gravity of the context can be accessed usingpango_context_get_base_gravity() and the <firstterm>resolved</firstterm>gravity of it using pango_context_get_gravity().  The resolved gravity isthe same as the base gravity for the most part, except that if the basegravity is set to %PANGO_GRAVITY_AUTO, the resolved gravity will dependon the current matrix set on context, and is derived usingpango_gravity_get_for_matrix().</para><para>The next thing an application may want to set on the context is the<firstterm>gravity hint</firstterm>.  A #PangoGravityHint instructs howdifferent scripts should react to the set base gravity.</para><para>Font descriptions have a gravity property too, that can be set usingpango_font_description_set_gravity() and accessed usingpango_font_description_get_gravity().  However, those are rarely usefulfrom application code and are mainly used by #PangoLayout internally.</para><para>Last but not least, one can create #PangoAttribute<!---->s for gravityand gravity hint using pango_attr_gravity_new() andpango_attr_gravity_hint_new().</para><!-- ##### SECTION See_Also ##### --><para>pango_context_get_base_gravity(),pango_context_set_base_gravity(),pango_context_get_gravity(),pango_context_get_gravity_hint(),pango_context_set_gravity_hint(),pango_font_description_set_gravity(),pango_font_description_get_gravity(),pango_attr_gravity_new(),pango_attr_gravity_hint_new()</para><!-- ##### SECTION Stability_Level ##### --><!-- ##### ENUM PangoGravity ##### --><para></para>@PANGO_GRAVITY_SOUTH: @PANGO_GRAVITY_EAST: @PANGO_GRAVITY_NORTH: @PANGO_GRAVITY_WEST: @PANGO_GRAVITY_AUTO: <!-- ##### MACRO PANGO_TYPE_GRAVITY ##### --><para>The #GObject type for #PangoGravity.</para><!-- ##### ENUM PangoGravityHint ##### --><para></para>@PANGO_GRAVITY_HINT_NATURAL: @PANGO_GRAVITY_HINT_STRONG: @PANGO_GRAVITY_HINT_LINE: <!-- ##### MACRO PANGO_TYPE_GRAVITY_HINT ##### --><para>The #GObject type for #PangoGravity.</para><!-- ##### MACRO PANGO_GRAVITY_IS_VERTICAL ##### --><para></para>@gravity: <!-- ##### FUNCTION pango_gravity_get_for_matrix ##### --><para></para>@matrix: @Returns: <!-- ##### FUNCTION pango_gravity_get_for_script ##### --><para></para>@script: @base_gravity: @hint: @Returns: <!-- ##### FUNCTION pango_gravity_to_rotation ##### --><para></para>@gravity: @Returns: 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -