<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # QRawFont Class Reference ## [[QtGui](index.htm) module] 該QRawFont類提供了訪問字體的單個物理實例。[More...](#details) ### Types * `enum AntialiasingType { PixelAntialiasing, SubPixelAntialiasing }` ### Methods * `__init__ (self)` * `__init__ (self, QString?fileName, float?pixelSize, QFont.HintingPreference?hintingPreference?=?QFont.PreferDefaultHinting)` * `__init__ (self, QByteArray?fontData, float?pixelSize, QFont.HintingPreference?hintingPreference?=?QFont.PreferDefaultHinting)` * `__init__ (self, QRawFont?other)` * `list-of-QPointF advancesForGlyphIndexes (self, list-of-int?glyphIndexes)` * `QImage alphaMapForGlyph (self, int?glyphIndex, AntialiasingType?antialiasingType?=?QRawFont.SubPixelAntialiasing, QTransform?transform?=?QTransform())` * `float ascent (self)` * `float averageCharWidth (self)` * `float descent (self)` * `QString familyName (self)` * `QByteArray fontTable (self, str?tagName)` * `list-of-int glyphIndexesForString (self, QString?text)` * `QFont.HintingPreference hintingPreference (self)` * `bool isValid (self)` * `float leading (self)` * `loadFromData (self, QByteArray?fontData, float?pixelSize, QFont.HintingPreference?hintingPreference)` * `loadFromFile (self, QString?fileName, float?pixelSize, QFont.HintingPreference?hintingPreference)` * `float maxCharWidth (self)` * `QPainterPath pathForGlyph (self, int?glyphIndex)` * `float pixelSize (self)` * `setPixelSize (self, float?pixelSize)` * `QFont.Style style (self)` * `QString styleName (self)` * `list-of-QFontDatabase.WritingSystem supportedWritingSystems (self)` * `bool supportsCharacter (self, int?ucs4)` * `bool supportsCharacter (self, QChar?character)` * `float unitsPerEm (self)` * `int weight (self)` * `float xHeight (self)` ### Static Methods * `QRawFont fromFont (QFont?font, QFontDatabase.WritingSystem?writingSystem?=?QFontDatabase.Any)` ### Special Methods * `bool __eq__ (self, QRawFont?other)` * `bool __ne__ (self, QRawFont?other)` * * * ## Detailed Description 該QRawFont類提供了訪問字體的單個物理實例。 **Note:**QRawFont是一個低級別的類。對于大多數用途[QFont](qfont.html)是一個比較合適的類。 最常見的是,在用戶界面中顯示文本時,確切的字體用于呈現字符在某種程度上是未知的。這可能是有幾個原因的情況:例如,在實際的物理存在于目標系統上的字體可能會不期而至的開發商,或者文本可以包含用戶選擇的樣式,尺寸或書寫系統不支持所選擇的字體的代碼。 因此, Qt的[QFont](qfont.html)類真正代表字體的查詢。當文本被解釋, Qt會盡力的文字查詢匹配,但根據的支持,不同的字體可用于在幕后。 對于大多數用例來說,這既是預期的和必要的,因為它最大限度地減少文本的用戶界面是不可顯示的可能性。在某些情況下,但是,更直接地控制這個過程可能是有用的。正是由于這些用例的QRawFont類存在。 一個QRawFont對象代表一個給定的字體在一個給定的像素大小單個物理實例。即在典型的情況下,它代表一組TrueType或OpenType字體表,并使用用戶指定的像素大小來度量轉換為邏輯像素單位。它可與組合使用[QGlyphRun](qglyphrun.html)類繪制特定的字形索引在特定位置,也有訪問到物理字體的一些相關數據。 QRawFont只提供了主要的字體技術支持: GDI和DirectWrite在Windows平臺上,[FreeType](index.htm#freetype)Symbian和Linux平臺和CoreText在Mac OS X。對于其他字體后端上,這些API將被禁用。 QRawFont可以以多種方式進行構造: * It can be constructed by calling QTextLayout.glyphs() or QTextFragment.glyphs(). The returned QGlyphs objects will contain QRawFont objects which represent the actual fonts used to render each portion of the text. * It can be constructed by passing a [QFont](qfont.html) object to [QRawFont.fromFont](qrawfont.html#fromFont)(). The function will return a QRawFont object representing the font that will be selected as response to the [QFont](qfont.html) query and the selected writing system. * It can be constructed by passing a file name or [QByteArray](qbytearray.html) directly to the QRawFont constructor, or by calling [loadFromFile](qrawfont.html#loadFromFile)() or [loadFromData](qrawfont.html#loadFromData)(). In this case, the font will not be registered in [QFontDatabase](qfontdatabase.html), and it will not be available as part of regular font selection. QRawFont被認為是本地在其構造(或者使用構造函數的線程,或致電[loadFromData](qrawfont.html#loadFromData)()或[loadFromFile](qrawfont.html#loadFromFile)())。該QRawFont不能移動到一個不同的線程,但會在有問題的線程被創建。 **Note:**對于緩存字形索引和字體選項的靜態文本,以避免重塑和relayouting在應用程序的內部循環的要求,更好的選擇是[QStaticText](qstatictext.html)類,因為它優化高速緩存的存儲器成本并且還提供了額外的加速繪圖引擎的特定高速緩存的可能性。 * * * ## Type Documentation ``` QRawFont.AntialiasingType ``` 這個枚舉變量代表了不同方式的字形可以在函數被光柵化[alphaMapForGlyph](qrawfont.html#alphaMapForGlyph)( ) 。 | Constant | Value | Description | | --- | --- | --- | | `QRawFont.PixelAntialiasing` | `0` | 通過測量全像素形狀的復蓋范圍將柵格化。返回的圖像中包含的每個像素的基礎上,字形形狀的復蓋范圍的alpha值。 | | `QRawFont.SubPixelAntialiasing` | `1` | 通過測量各子像素的顯示,對于每個各像素的紅色,綠色和藍色分量的返回一個單獨的α值將柵格化。 | * * * ## Method Documentation ``` QRawFont.__init__ (self) ``` 構造一個無效的[QRawFont](qrawfont.html)。 ``` QRawFont.__init__ (self, QString?fileName, float?pixelSize, QFont.HintingPreference?hintingPreference?=?QFont.PreferDefaultHinting) ``` 構造一個[QRawFont](qrawfont.html)表示包含由所引用的文件中的字體_fileName_對于通過給定的大小(以像素為單位)_pixelSize_,并使用所指定的提示的優先級_hintingPreference_。 **Note:**引用的文件必須包含一個TrueType或OpenType字體。 ``` QRawFont.__init__ (self, QByteArray?fontData, float?pixelSize, QFont.HintingPreference?hintingPreference?=?QFont.PreferDefaultHinting) ``` 構造一個[QRawFont](qrawfont.html)表示包含在所提供的字體_fontData_對于通過給定的大小(以像素為單位)_pixelSize_,并使用所指定的提示的優先級_hintingPreference_。 **Note:**該數據必須包含TrueType或OpenType字體。 ``` QRawFont.__init__ (self, QRawFont?other) ``` 創建[QRawFont](qrawfont.html)這是一個拷貝_other_。 ``` list-of-QPointF QRawFont.advancesForGlyphIndexes (self, list-of-int?glyphIndexes) ``` 返回[QRawFont](qrawfont.html)的前進對每個_glyphIndexes_以像素為單位。該貸款給從給定字形的位置到下一個字形應繪制,使其看起來好像兩個字形unspaced的距離。 **See also** [QTextLine.horizontalAdvance](qtextline.html#horizontalAdvance)()和[QFontMetricsF.width](qfontmetricsf.html#width)( ) 。 ``` QImage QRawFont.alphaMapForGlyph (self, int?glyphIndex, AntialiasingType?antialiasingType?=?QRawFont.SubPixelAntialiasing, QTransform?transform?=?QTransform()) ``` [](qimage.html) [該函數返回字形的光柵化圖像在給定的_glyphIndex_在底層的字體,用_transform_規定。如果](qimage.html)[QRawFont](qrawfont.html)是無效的,該函數將返回一個無效[QImage](qimage.html)。 If _antialiasingType_被設置為[QRawFont.SubPixelAntialiasing](qrawfont.html#AntialiasingType-enum),然后將生成的圖像將在[QImage.Format_RGB32](qimage.html#Format-enum)和每個像素的RGB值,將表示在該字形的光柵化的像素的子像素的不透明度。否則,圖像將在格式[QImage.Format_Indexed8](qimage.html#Format-enum)和每個像素將包含像素的光柵化的不透明度。 **See also** [pathForGlyph](qrawfont.html#pathForGlyph)()和[QPainter.drawGlyphRun](qpainter.html#drawGlyphRun)( ) 。 ``` float QRawFont.ascent (self) ``` 返回此東昇[QRawFont](qrawfont.html)以像素為單位。 **See also** [QFontMetricsF.ascent](qfontmetricsf.html#ascent)( ) 。 ``` float QRawFont.averageCharWidth (self) ``` 返回此字符的平均寬度[QRawFont](qrawfont.html)以像素為單位。 **See also** [QFontMetricsF.averageCharWidth](qfontmetricsf.html#averageCharWidth)( ) 。 ``` float QRawFont.descent (self) ``` 返回此下降[QRawFont](qrawfont.html)以像素為單位。 **See also** [QFontMetricsF.descent](qfontmetricsf.html#descent)( ) 。 ``` QString QRawFont.familyName (self) ``` 返回此姓氏[QRawFont](qrawfont.html)。 ``` QByteArray QRawFont.fontTable (self, str?tagName) ``` [ 檢索評為SFNT表_tagName_從底層的物理字體,或者一個空字節數組,如果沒有這樣的表被發現。返回的字體表中的字節順序是大端,像SFNT格式指定。該_tagName_必須為四個字符,并應在當前平臺的默認字節順序進行格式化。 ](qbytearray.html) ``` QRawFont QRawFont.fromFont (QFont?font, QFontDatabase.WritingSystem?writingSystem?=?QFontDatabase.Any) ``` [ 取基于物理表示_font_查詢。返回的物理字體是由Qt的首選,以在選定的顯示文本的字體_writingSystem_。 ``` list-of-int QRawFont.glyphIndexesForString (self, QString?text) ``` unicode的點串由下式給出轉換_text_使用CMAP表的基本字體到字形索引,并返回包含結果的載體。 ](qrawfont.html) [需要注意的是,在存在于該字體的其他表影響文本的成形的情況下,返回的字形索引將不正確地表示該文本的渲染。為了得到正確的形文字,可以使用](qrawfont.html)[QTextLayout](qtextlayout.html)布置和形狀的文本,然后調用QTextLayout.glyphs ( )來獲取一套字形索引列表和[QRawFont](qrawfont.html)對。 **See also** [advancesForGlyphIndexes](qrawfont.html#advancesForGlyphIndexes)( )[glyphIndexesForChars](qrawfont.html#glyphIndexesForChars)( )[QGlyphRun](qglyphrun.html),[QTextLayout.glyphRuns](qtextlayout.html#glyphRuns)()和[QTextFragment.glyphRuns](qtextfragment.html#glyphRuns)( ) 。 ``` QFont.HintingPreference QRawFont.hintingPreference (self) ``` [](qfont.html#HintingPreference-enum) [返回用于構造這個暗示偏好](qfont.html#HintingPreference-enum)[QRawFont](qrawfont.html)。 **See also** [QFont.hintingPreference](qfont.html#hintingPreference)( ) 。 ``` bool QRawFont.isValid (self) ``` 返回True如果[QRawFont](qrawfont.html)是有效的,否則為False。 ``` float QRawFont.leading (self) ``` 返回此領先[QRawFont](qrawfont.html)以像素為單位。 **See also** [QFontMetricsF.leading](qfontmetricsf.html#leading)( ) 。 ``` QRawFont.loadFromData (self, QByteArray?fontData, float?pixelSize, QFont.HintingPreference?hintingPreference) ``` 替換當前[QRawFont](qrawfont.html)與包含在所提供的字體_fontData_對于通過給定的大小(以像素為單位)_pixelSize_,并使用所指定的提示的優先級_hintingPreference_。 該_fontData_必須包含TrueType或OpenType字體。 **See also** [loadFromFile](qrawfont.html#loadFromFile)( ) 。 ``` QRawFont.loadFromFile (self, QString?fileName, float?pixelSize, QFont.HintingPreference?hintingPreference) ``` 替換當前[QRawFont](qrawfont.html)由所引用的文件中的內容_fileName_對于通過給定的大小(以像素為單位)_pixelSize_,并使用所指定的提示的優先級_hintingPreference_。 該文件必須引用一個TrueType或OpenType字體。 **See also** [loadFromData](qrawfont.html#loadFromData)( ) 。 ``` float QRawFont.maxCharWidth (self) ``` 返回最寬的字符的字體的寬度。 **See also** [QFontMetricsF.maxWidth](qfontmetricsf.html#maxWidth)( ) 。 ``` QPainterPath QRawFont.pathForGlyph (self, int?glyphIndex) ``` [](qpainterpath.html) [這個函數返回該字形的形狀在給定的_glyphIndex_在底層的字體,如果](qpainterpath.html)[QRawFont](qrawfont.html)是有效的。否則,它返回一個空[QPainterPath](qpainterpath.html)。 返回的字形將始終unhinted 。 **See also** [alphaMapForGlyph](qrawfont.html#alphaMapForGlyph)()和[QPainterPath.addText](qpainterpath.html#addText)( ) 。 ``` float QRawFont.pixelSize (self) ``` 返回此像素大小設置[QRawFont](qrawfont.html)。像素大小會影響字形光柵,通過回字形的大小[pathForGlyph](qrawfont.html#pathForGlyph)() ,并用于內部度量轉換設計單位邏輯像素單位。 **See also** [setPixelSize](qrawfont.html#setPixelSize)( ) 。 ``` QRawFont.setPixelSize (self, float?pixelSize) ``` 設置像素大小與該字體應該被渲染到_pixelSize_。 **See also** [pixelSize](qrawfont.html#pixelSize)( ) 。 ``` QFont.Style QRawFont.style (self) ``` [](qfont.html#Style-enum) [返回此風格](qfont.html#Style-enum)[QRawFont](qrawfont.html)。 **See also** [QFont.style](qfont.html#style)( ) 。 ``` QString QRawFont.styleName (self) ``` 返回此樣式名[QRawFont](qrawfont.html)。 **See also** [QFont.styleName](qfont.html#styleName)( ) 。 ``` list-of-QFontDatabase.WritingSystem QRawFont.supportedWritingSystems (self) ``` 返回根據設計師對字體支持的書寫系統列表中的字體文件中提供的信息。請注意,這并不能保證在字體特定的Unicode點支撐。您可以使用[supportsCharacter](qrawfont.html#supportsCharacter)( )來檢查一個單一的,特定的字符支持。 **Note:**該列表是基于字體的OS / 2表設置,需要這樣一個表存在于底層的字體文件Unicode范圍和代碼頁范圍內確定。 **See also** [supportsCharacter](qrawfont.html#supportsCharacter)( ) 。 ``` bool QRawFont.supportsCharacter (self, int?ucs4) ``` 如果字體有對應于給定的字形,則返回True_character_。 **See also** [supportedWritingSystems](qrawfont.html#supportedWritingSystems)( ) 。 ``` bool QRawFont.supportsCharacter (self, QChar?character) ``` 這是一個重載函數。 如果字體有對應于UCS- 4編碼的字符的字形,則返回True_ucs4_。 **See also** [supportedWritingSystems](qrawfont.html#supportedWritingSystems)( ) 。 ``` float QRawFont.unitsPerEm (self) ``` 返回設計單位的數量界定em方形這個的寬度和高度[QRawFont](qrawfont.html)。此值與像素尺寸轉換設計度量時,以像素單位使用的,作為內部度量在設計單位指定與像素大小給出1烯的大小(像素)。 **See also** [pixelSize](qrawfont.html#pixelSize)()和[setPixelSize](qrawfont.html#setPixelSize)( ) 。 ``` int QRawFont.weight (self) ``` 返回此重量[QRawFont](qrawfont.html)。 **See also** [QFont.weight](qfont.html#weight)( ) 。 ``` float QRawFont.xHeight (self) ``` 返回此的xHeight[QRawFont](qrawfont.html)以像素為單位。 **See also** [QFontMetricsF.xHeight](qfontmetricsf.html#xHeight)( ) 。 ``` bool QRawFont.__eq__ (self, QRawFont?other) ``` ``` bool QRawFont.__ne__ (self, QRawFont?other) ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看