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

📄 sec-itemreference.html

📁 gtk_text program sample&eg
💻 HTML
📖 第 1 页 / 共 4 页
字号:
            </tr>            <tr>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">fill_stipple</span>              </td>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">GdkBitmap*</span>              </td>              <td align="LEFT" valign="TOP">                Both              </td>              <td align="LEFT" valign="TOP">                Stipple to use when drawing fill; GDK mode only              </td>            </tr>            <tr>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">outline_stipple</span>              </td>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">GdkBitmap*</span>              </td>              <td align="LEFT" valign="TOP">                Both              </td>              <td align="LEFT" valign="TOP">                Stipple to use when drawing outline; GDK mode only              </td>            </tr>            <tr>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">width_pixels</span>              </td>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">guint</span>              </td>              <td align="LEFT" valign="TOP">                Write-only              </td>              <td align="LEFT" valign="TOP">                Width of the outline, in pixels (independent of                zoom)              </td>            </tr>            <tr>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">width_units</span>              </td>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">double</span>              </td>              <td align="LEFT" valign="TOP">                Write-only              </td>              <td align="LEFT" valign="TOP">                Width of the outline, in canvas units; pixel width                changes with zoom factor (pixels per unit)              </td>            </tr>          </table>        </div>      </div>      <div class="SECT2">        <h2 class="SECT2">          <a name="SEC-CANVASIMAGE">Image Item</a>        </h2>        <p>          <span class="STRUCTNAME">GnomeCanvasImage</span> places          an image on the canvas; you pass it a <span class=           "STRUCTNAME">GdkImlibImage</span>, loaded using one of          the Imlib routines. If the image has transparent areas,          they will be properly handled (they won't be considered          part of the item, and will not receive events). To use          <span class="STRUCTNAME">GnomeCanvasImage</span> with a          GDK canvas, you must push the Imlib visual and colormap          before creating the canvas; see <a href=           "z177.html#SEC-CANVASPREPARE">the section called <i>          Preparing the <tt class="CLASSNAME">GnomeCanvas</tt>          Widget</i></a>.        </p>        <div class="TABLE">          <a name="TAB-GNOME-CANVAS-IMAGE"></a>          <p>            <b>Table 4. <span class="STRUCTNAME">            GnomeCanvasImage</span> Arguments</b>          </p>          <table border="1" bgcolor="#E0E0E0" cellspacing="0"          cellpadding="4" class="CALSTABLE">            <tr>              <th align="LEFT" valign="TOP">                Name              </th>              <th align="LEFT" valign="TOP">                Type              </th>              <th align="LEFT" valign="TOP">                Read/Write              </th>              <th align="LEFT" valign="TOP">                Description              </th>            </tr>            <tr>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">image</span>              </td>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">GdkImlibImage*</span>              </td>              <td align="LEFT" valign="TOP">                Both              </td>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">GdkImlibImage</span> to                display              </td>            </tr>            <tr>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">x</span>              </td>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">double</span>              </td>              <td align="LEFT" valign="TOP">                Both              </td>              <td align="LEFT" valign="TOP">                X coordinate of the anchor point              </td>            </tr>            <tr>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">y</span>              </td>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">double</span>              </td>              <td align="LEFT" valign="TOP">                Both              </td>              <td align="LEFT" valign="TOP">                Y coordinate of the anchor point              </td>            </tr>            <tr>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">anchor</span>              </td>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">GtkAnchorType</span>              </td>              <td align="LEFT" valign="TOP">                Both              </td>              <td align="LEFT" valign="TOP">                Location of anchor point              </td>            </tr>            <tr>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">width</span>              </td>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">double</span>              </td>              <td align="LEFT" valign="TOP">                Both              </td>              <td align="LEFT" valign="TOP">                Width in canvas units (image will be scaled)              </td>            </tr>            <tr>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">height</span>              </td>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">double</span>              </td>              <td align="LEFT" valign="TOP">                Both              </td>              <td align="LEFT" valign="TOP">                Height in canvas units (image will be scaled)              </td>            </tr>          </table>        </div>      </div>      <div class="SECT2">        <h2 class="SECT2">          <a name="SEC-GNOMECANVASTEXT">Text Item</a>        </h2>        <p>          <span class="STRUCTNAME">GnomeCanvasText</span> displays          a text string. You can specify the coordinates of the          string as an ordered pair; these coordinates will          represent the location of the text's <i class=          "FIRSTTERM">anchor</i>. For example, if the <span class=           "STRUCTNAME">"anchor"</span> argument is set to <span          class="STRUCTNAME">GTK_ANCHOR_NORTH</span>, the text          item's coordinates will represent the location of the          top-center of the item. That is, the text will be          centered around the X position and begin just below the Y          position. Possible anchor values are:        </p>        <ul>          <li>            <p>              <span class="STRUCTNAME">GTK_ANCHOR_CENTER</span>            </p>          </li>          <li>            <p>              <span class="STRUCTNAME">GTK_ANCHOR_NORTH</span>            </p>          </li>          <li>            <p>              <span class="STRUCTNAME">GTK_ANCHOR_NORTH_WEST</span>            </p>          </li>          <li>            <p>              <span class="STRUCTNAME">GTK_ANCHOR_NORTH_EAST</span>            </p>          </li>          <li>            <p>              <span class="STRUCTNAME">GTK_ANCHOR_SOUTH</span>            </p>          </li>          <li>            <p>              <span class="STRUCTNAME">GTK_ANCHOR_SOUTH_WEST</span>            </p>          </li>          <li>            <p>              <span class="STRUCTNAME">GTK_ANCHOR_SOUTH_EAST</span>            </p>          </li>          <li>            <p>              <span class="STRUCTNAME">GTK_ANCHOR_WEST</span>            </p>          </li>          <li>            <p>              <span class="STRUCTNAME">GTK_ANCHOR_EAST</span>            </p>          </li>        </ul>        <p>          Affine transformation of <span class="STRUCTNAME">          GnomeCanvasText</span> is not implemented very well.          Because the X font model is inflexible and limited, there          is no good way to rotate and otherwise transform rendered          text. In antialiased mode the canvas item implements this          in the only way it can: it draws the entire font to a          <span class="STRUCTNAME">GdkPixmap</span>, then copies          the pixmap to a <span class="STRUCTNAME">GdkImage</span>,          then reads individual pixels out of the image into a          client-side bitmap, then copies the characters to be          displayed from the entire-font bitmap into a temporary          buffer, then uses <tt class="APPLICATION">          libart_lgpl</tt> to apply any affine transformations to          this buffer, then copies the transformed buffer to the          canvas RGB buffer. Finally the canvas copies the RGB          buffer to the screen. Needless to say this is slower than          molasses: an entire bitmap goes over the network more          than once. Moreover, scaling and rotating fonts as          bitmaps leads to a low quality image. If you try to use          <span class="STRUCTNAME">GnomeCanvasText</span> with          antialiased mode, you will probably notice this; if your          canvas is slow to update, suspect the text item.        </p>        <p>          There are plans to fix the text item, using a new font          abstraction called <span class="STRUCTNAME">          GnomeFont</span>. However, Gnome 1.0 lacks this feature.        </p>        <p>          There is not a good solution to the problem; if your          application allows it, you can get dramatic speed          increases by creating your own text item that caches the          entire-font bitmaps. However, if you don't reuse the same          fonts often, caching will be useless. Another possibility          is to abandon X fonts and use Type 1 fonts with a          rasterization library like <tt class="APPLICATION">          t1lib</tt>, but this limits the fonts available to you          and adds a library dependency. You could also use True          Type fonts with the FreeType library, or use the Display          PostScript extension to X (XDPS).        </p>        <p>          Unfortunately, your best bet is probably to wait for the          <span class="STRUCTNAME">GnomeFont</span> feature in a          future version of the Gnome libraries.        </p>        <div class="TABLE">          <a name="TAB-GNOME-CANVAS-TEXT"></a>          <p>            <b>Table 5. <span class="STRUCTNAME">            GnomeCanvasText</span> Arguments</b>          </p>          <table border="1" bgcolor="#E0E0E0" cellspacing="0"          cellpadding="4" class="CALSTABLE">            <tr>              <th align="LEFT" valign="TOP">                Name              </th>              <th align="LEFT" valign="TOP">                Type              </th>              <th align="LEFT" valign="TOP">                Read/Write              </th>              <th align="LEFT" valign="TOP">                Description              </th>            </tr>            <tr>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">text</span>              </td>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">gchar*</span>              </td>              <td align="LEFT" valign="TOP">                Both              </td>              <td align="LEFT" valign="TOP">                String to display              </td>            </tr>            <tr>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">x</span>              </td>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">double</span>              </td>              <td align="LEFT" valign="TOP">                Both              </td>              <td align="LEFT" valign="TOP">                X coordinate of the anchor point              </td>            </tr>            <tr>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">y</span>              </td>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">double</span>              </td>              <td align="LEFT" valign="TOP">                Both              </td>              <td align="LEFT" valign="TOP">                Y coordinate of the anchor point              </td>            </tr>            <tr>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">anchor</span>              </td>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">GtkAnchorType</span>              </td>              <td align="LEFT" valign="TOP">                Both              </td>              <td align="LEFT" valign="TOP">                Location of anchor point              </td>            </tr>            <tr>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">font</span>              </td>              <td align="LEFT" valign="TOP">                <span class="STRUCTNAME">gchar*</span>              </td>              <td align="LEFT" valign="TOP">                Write-only              </td>

⌨️ 快捷键说明

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