FreeType has font metrics for the underline position, but I can't seem to find any metrics for the strikethrough position. How do text engines usually compute this value? Should I just put it at 1/3*ascent or whatever looks good? I suppose that for Latin at least this should be 1/2*height of "m" but I'm looking for a more general solution.
How to get the height at which to draw a strikethrough from FreeType
358 Views Asked by AudioBubble At
1
There are 1 best solutions below
Related Questions in FREETYPE
- How to render Font/Text in wayland in Ubuntu with egl?
- how to use fallback font to draw text with xlib/libxft?
- freetype with xft and xlib, changing the font size does not work
- What are the values for "drop-out mode" in freetype?
- Can't find ft2build.h when building with Yocto SDK
- Proper way to create Direct2D bitmap from FreeType bitmap
- Memory corruption caused by FT_Render_Glyph() API of FreeType
- Failed building wheels for matplotlib
- Rendering TrueType fonts as fixed size (like in a terminal emulator)
- Drawing text failes with 1282 error | GLFW3 & Freetype
- How to get available Glyph ranges in a font using FreeType lib API
- xcb unable to display freetype bitmap
- configure freetype with an error cannot find native C compiler
- Using freetype-gl to render fonts but seemingly only getting the quads vertices and about 1/4 of the text
- FreeType error: FT_LOAD_GLYPH returns 140 with Brush Script MT font on MacOS
Related Questions in STRIKETHROUGH
- How to detect "strikethrough" cells in an ODS spreadsheet file in Python?
- Extract Strikethrough Text in Image in Python List Format
- How to strikethrough substrings without spaces in Sphinx?
- why does a function have strike through in the text
- Strike through a div on click
- JComboBox comboBox=new JComboBox(); is showing tex strike through on "new JComboBox()"
- Create a Strikethrough on Entire Div, Rather than Text Within
- Pandas read excel and flag rows with striketrough
- MS-Project - Font Style replacement (Inactive Tasks)
- Is there a way to strikethrough a whole row in Markdown tables?
- How to delete strikethrough without changing color, bold, italic settings?
- Remove styling applied by <del> tag
- Checkbox Strikeout text when ticked
- List Item supposed to strikethrough on click, not working
- How to Strikethrough text in Row A25 to D25 if Cell f25 has any value
Related Questions in FONTMETRICS
- Why fonts loaded using CoreText (CTFont) behave different than loaded using AppKit (NSFont)?
- How the GetTextMetrics method gets the font metrics from a font ?
- What causes FontMetrics stringWidth to return different values on different machines?
- How to get the ascent and descent of a specific string with font applied
- Resize JTable to fit contents does not work precisely, resulting in elipses
- Getting the glyph width of a monospaced font
- MyClass cannot access class com.sun.javafx.tk.Toolkit because module javafx.graphics does not export com.sun.javafx.tk to unnamed module
- How do we set a custom line height in a TextView?
- Draw string inside rectangle visually
- Without Canvas(HTML5 element), how to measure TextMetrics like ascent, descent, CapHeight of font in JavaScript
- I can't center text in java swing
- How to get FontMetrics from only Font and FontRenderContext
- Get font glyph metrics with Swift
- How to get the height at which to draw a strikethrough from FreeType
- What is the difference between alphabetic and ideographic in Flutter's TextBaseline enum
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
This information is not provided for all the various font formats supported by Freetype; so it is not exposed on the "main" interface.
In the (common but not universal) case of TrueType or OpenType fonts it can be retrieved in the TT_OS2 table, fields
yStrikeoutSizeandyStrikeoutPosition; you should be prepared for the table to be lacking, oryStrikeoutSizeto be null or negative thus unusable.I do not remember of an equivalent for plain Postscript fonts (
.pfb/.pfa, even in.afm.) The various bitmap formats might have the information available; an example isstrike_outin Windows FNT; notice this is the position, while the size defaults to be the same as underlining. Basically every format is alone here.