Code Monkey home page Code Monkey logo

fonts's Introduction

SixLabors.Fonts
SixLabors.Fonts

Build Status codecov License: Six Labors Split GitHub issues GitHub stars GitHub forks

SixLabors.Fonts is a new cross-platform font loading and drawing library.

License

Support Six Labors

Support the efforts of the development of the Six Labors projects.

Documentation

  • Detailed documentation for the Fonts API is available. This includes additional conceptual documentation to help you get started.
  • Our Samples Repository is also available containing buildable code samples demonstrating common activities.

Questions

Code of Conduct

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.

Installation

Install stable releases via Nuget; development releases are available via Feedz.io.

Package Name Release (NuGet) Nightly (Feedz.io)
SixLabors.Fonts NuGet feedz.io

Manual build

If you prefer, you can compile Fonts yourself (please do and help!)

Alternatively, you can work from command line and/or with a lightweight editor on both Linux/Unix and Windows:

To clone Fonts locally, click the "Clone in [YOUR_OS]" button above or run the following git commands:

git clone https://github.com/SixLabors/Fonts

If working with Windows please ensure that you have enabled log file paths in git (run as Administrator).

git config --system core.longpaths true

Submodules

This repository contains git submodules. To add the submodules to the project, navigate to the repository root and type:

git submodule update --init --recursive

Features

  • Reading font description (name, family, subname etc plus other string metadata).
  • Loading OpenType fonts with with CFF1 and True Type outlines.
  • Loading True Type fonts.
  • Loading WOFF fonts.
  • Loading WOFF2 fonts.
  • Load all compatible fonts from local machine store.
  • Support for line breaking based on UAX 14
  • Support for rendering left to right, right to left and bidirectional text.
  • Support for ligatures.
  • Support for advanced OpenType features glyph substitution (GSUB) and glyph positioning (GPOS)

API Examples

Read font description

FontDescription description = null;
using(var fs = File.OpenRead("Font.ttf")){
    description = FontDescription.Load(fs); // once it has loaded the data the stream is no longer required and can be disposed of
}

string name = description.FontName(CultureInfo.InvariantCulture);

Populating a font collection

FontCollection fonts = new FontCollection();
FontFamily font1 = fonts.Add("./path/to/font1.ttf");
FontFamily font2 = fonts.Add("./path/to/font2.woff");

How can you help?

Please... Spread the word, contribute algorithms, submit performance improvements, unit tests.

Projects using SixLabors.Fonts

The SixLabors.Fonts Team

fonts's People

Contributors

0xced avatar antonfirsov avatar batwomankt avatar bbo76 avatar brianpopow avatar bykiev avatar cptwesley avatar dependabot[bot] avatar dlemstra avatar feliwir avatar garciaolais avatar gerdus avatar iamcarbon avatar jafin avatar jairbubbles avatar jimbobsquarepants avatar jjagg avatar leafrock avatar loraderon avatar manuelhu avatar markciliavincenti avatar nakamura2000 avatar redth avatar snechaev avatar steffi3011 avatar techpizzadev avatar teo-tsirpanis avatar tocsoft avatar turnerj avatar woutware avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fonts's Issues

superscript

render portions of text in a superscript style

Make FontInstance public

Currently FontInstance is internal, meaning I can't call the LoatFont variants from my code and I'm forced to use FontCollection.
However FontCollection is not a useful abstraction for me: it first loads the font from the stream and then checks if the family name already exists.
I know better in my code and have my own caching to prevent loading the font from the stream in the first place (using file name or embedded resource id as the key) if it's already loaded so I don't need FontCollection and it just adds overhead with those dictionary checks and the lock:

lock (this.instances)

Making FontInstance public would allow me to implement my own caching without those overheads.

"Index was outside the bounds of the array."

Error Using ImageSharp.Drawing, but the error is related to the font.

Not really sure if I should post the issue here or on ImageSharp, but as it seems to be font related I posted it here

I have the latest packages of
ImageSharp - 1.0.0-alpha5-00069
ImageSharp.Drawing - 1.0.0-alpha5-00063
SixLabors.Fonts - 0.1.0-alpha0006

Again using a font from Google Fonts, this is the font that caused the error
https://fonts.google.com/specimen/Love+Ya+Like+A+Sister

The error occurs in this method from previous answer for Text Wrapping issue thread
https://github.com/SixLabors/Demos/blob/master/WaterMarkSample/Program.cs#L71

at ImageSharp.Processing.ImageProcessor1.Apply(ImageBase1 source, Rectangle sourceRectangle)
at ImageSharp.Image1.ApplyProcessor(IImageProcessor1 processor, Rectangle rectangle)
at ImageSharp.ImageExtensions.DrawText[TColor](Image1 source, String text, Font font, IBrush1 brush, IPen1 pen, Vector2 location, TextGraphicsOptions options) at ImageSharp.ImageExtensions.DrawText[TColor](Image1 source, String text, Font font, TColor color, Vector2 location, TextGraphicsOptions options)

This is the Inner Exception

at SixLabors.Shapes.InternalPath.FindIntersections(Vector2 start, Vector2 end, Vector2[] buffer, Int32 count, Int32 offset)
at SixLabors.Shapes.ComplexPolygon.FindIntersections(Vector2 start, Vector2 end, Vector2[] buffer, Int32 count, Int32 offset)
at ImageSharp.Drawing.ShapeRegion.Scan(Single y, Single[] buffer, Int32 length, Int32 offset)
at ImageSharp.Drawing.Processors.FillRegionProcessor1.OnApply(ImageBase1 source, Rectangle sourceRectangle)
at ImageSharp.Processing.ImageProcessor1.Apply(ImageBase1 source, Rectangle sourceRectangle)

Support word breaking

Add a flag to RenderOptions to turn on word breaking.

wher word breaking is the ability to cut words in half at word wrapping boundries.

'loop detected loading glyphs'

I get this error a lot if I try to use a .ttf font I have downloaded from Google Fonts
I have tried many different fonts and this is a common error with most of the fonts I have downloaded from Google Fonts

This is how I load the fonts

            var collection = new FontCollection();
            var font = collection.Install($"{_env.WebRootPath}\\fonts\\CarterOne.ttf");

This is using SixLabors.Fonts in ImageSharp.Drawing

at SixLabors.Fonts.Tables.General.Glyphs.EmptyGlyphLoader.CreateGlyph(GlyphTable table)
at SixLabors.Fonts.FontInstance.GetGlyph(Char character)
at SixLabors.Fonts.TextLayout.GenerateLayout(String text, FontSpan style)
at SixLabors.Fonts.TextMeasurer.MeasureText(String text, FontSpan style)

Any tab after the third in a line doesn't get rendered

When rendering a string that contains more than 3 tabs, only the first 3 are rendered. I haven't found out completely how it works yet, but that seems to be the general gist of it. The easiest way to reproduce the bug is comparing how the strings "\t\t\tx" and "\t\t\t\tx" get rendered.

Pixel grid aligning

provide a flag to enable pixel grid aligning

pixel grid aligning is the act of offsetting the glyph so that it move closely aligns with the underlying pixel grid.

Use int for character representation to support full Unicode

To support the full Unicode range, the character representation should map to a Unicode codepoint which is 32-bit. Currently char is used. This is important to support characters that require 4 bytes in UTF-16 like emoji. I have a branch in my fork where I changed the internal representation to UTF-32 (by using int everywhere instead of char), so I can set up a PR if that's all right :)
Jjagg@4c058ec?w=1

The only change in functionality is in TextLayout.cs to keep it easy to review. For 2-byte UTF-16 characters nothing changed functionally at all.

Feature Request: Expose font glyphs, geometry, etc

Although the main focus of SixLabors.Fonts is to provide font rendering features to ImageSharp, I don't see why it can't be used for much more than that.

So I would like to request to expose glyph information such as:

  • Glyph Metrics
  • Glyph Geometry

Glyph metrics are required in case you want to create a texture font atlas, as used by game engines, where each letter is rendered into the texture, and the corresponding glyph metadata is stored in a separate file, so the engine can use it to render text on its own.

Glyph geometry (both raw and triangulated) can be used for vector graphics, or rendering large form factor text in videogames.

Add a FontCollection object for managing loaded fonts

A FontCollection becomes the root object for dealing with loading fonts from disk/streams.

FontCollections can cascade. i.e. you could have a global font collection and new up a new one which has the global one as a parent then add fonts to the child collection and you will be able to use files loaded into either context and disposing of the child context would free up data from only the newed/overridden fonts.

TextMeasurer returns wrong sizes for single glyphs

I´m using beta 02.

When I try to render a font to a image by rendering each character individually (to create a bitmap font), the text measurer causes the characters to missalign.

Sample code

The results of this code look like this to me:
1517073213

The problem is not fixed by using the MeasureBounds method and using the Right property as the width.

Is this a missconception in my code or a possible bug?

Edit: it was a logical mistake

Expand details returned by IGlyphRenderer.BeginGlyph to allow for systems to cache renders

Add a unique glyph instance id to the IGlyphRenderer.BeginGlyph to enable systems to be able to cache rendered glyphs and skip the more expensive vector rending if they already have a cached rasterized glyph.

The unique instance id should be unique across all aspects of a glyph that could cause it to require rendering differently. Font size, glyph index, font name & style (it should/would only require being unique for the lifetime of the process, i.e be a HashCode)

Add a lazy file based Font Api

Create a version of the Font class FileFont that reads the name & OS\2 tables to get the meta data about the font but immediately closes the file reader until more details are required (I.E. loading glyph data ) at which point it loads the full font definition from the source file for full usage.

layout wrapping support

pass in a rectangle into the layout engine and it should auto wrap text at the provided width.

provide glyph rendering position to IGlyphRenderer (to enable position based rendering effects)

update IGlyphRenderer so the BeginGlyph() will be passed the location/glyph metadata at the start of the rendering pass.

This will allow 3rd parties to provide a version of IGlyphRenderer that (based on the location) could skew/transform subsequent points.

This would enable those 3rd parties to be able to perform an effect like rendering text along a path by applying rotation and translations based on the X/Y coordinate generated by the Layout Engine.

Strange "Bleeding" fonts

I am not sure if this is related to the actual fonts been badly made or if it is an issue also with the "Shapes" libary... It looks like the shapes being drawn for the font charaters are missing a point and therefore assume a point of 0,0

It is not all fonts only a few I have found in the "Serif" section of Google Fonts

I have the latest packages of
ImageSharp - 1.0.0-alpha5-00069
ImageSharp.Drawing - 1.0.0-alpha5-00063
SixLabors.Fonts - 0.1.0-alpha0006
SixLabors.Shapes - 0.1.0-alpha0010

I have found a number of fonts that do this a few listed below (all downloaded from google fonts)
Marko One
Coustard
Wendy One

The image is an example of the issue with these fonts, again this was made using the method from the Text Wrapping demo https://github.com/SixLabors/Demos/blob/master/WaterMarkSample/Program.cs#L71

bleeding shapes-fonts

SystemFontCollection: File names/extensions are case sensitive under Linux

Problem:

When using SystemFontCollection, On This Line, it'll try to look for fonts using the *.ttf filter.

That will fail on Unix systems if the font file has a *.TTF extension (uppercase) instead, since its has a case sensitive file system.

Possible Solution:

Alternatively, replace that line with

IEnumerable<string> files = 
    found.SelectMany(x => Directory.EnumerateFiles(x, "*.*", SearchOption.AllDirectories))
         .Where(x => Path.GetExtension(x).Equals(".ttf", StringComparison.OrdinalIgnoreCase));

So its more reliable on platforms other than windows.

Tested on:

  • .NET Core 2.0.4-servicing-25915-01 @ Raspbian (armhf)
  • .NET Core 2.0.0 @ Debian 9 (x64)

edited to perma-link the source line reference

subscript

render portions of text in a subscript style

Vertical Align options

Option to provide vertical align options to render to change the logic about what local means, does it refer to top middle or bottom of the final glyphs.

Scaled Word Wrap

var style = new FontSpan(f, 72) { WrappingWidth = targetWidth };
s = measurer.MeasureText(text, style);

This is the code from the example you gave before for doing "Scaled Word Wrap"
but this no longer works in the latest versions

Is there a new way to achieve the same as above?

Previous issue where you gave the example code
layout wrapping support #4

Provide installed fonts collection

Add cross platform system for enumerating all the fonts installed on a users machine and expose them as a FontCollection.

Most OSs have a standard location where fonts will be installed

On Linux

  • ~/.fonts/ - for your own fonts.
  • /usr/local/share/fonts/ - system-wide, user installed fonts.
  • /usr/share/fonts/ - system's font location.

On mac OS

  • ~/Library/Fonts/ - Each user has complete control over the fonts installed in their Home. These fonts are available to that user when he or she is logged in to the computer. Fonts installed here are not available to all users of the computer.
  • /Library/Fonts/ - Any local user of the computer can use fonts installed in this folder. Mac OS X does not require these additional fonts for system operation. An admin user can modify the contents of this folder. This is the recommended location for fonts that are shared among applications.
  • /Network/Library/Fonts/ - The Network folder is for fonts shared among all users of a local area network. This feature is normally used on network file servers, under the control of a network administrator.
  • /System/Library/Fonts/ - Mac OS X requires fonts in this folder for system use and displays. They should not be manually altered or removed.
  • /System Folder/Fonts/ - This folder contains fonts used by the Classic environment (Mac OS X v10.4 or earlier only). If more than one Mac OS 9.1 System Folder is present, only fonts in the System Folder selected in the Classic pane of System Preferences are used. Classic applications can access only these fonts, not those stored elsewhere. Conversely, Mac OS X applications can use these fonts, even when the Classic environment is not active.

On windows

  • %SYSTEMROOT%\Fonts - usually c:\Windows\Fonts

depend on #13

Update `FontCollection` to use `FileFontInstance` by default for file path based fonts

At the moment there are 2 types of FontCollections the public one and a static SystemFontCollection

SystemFontCollection uses a FontFileInstance to limit the up font loading required when accessing it the first time. instead of loading in all the font glyph data up front it loads the FontDescription first and then only as any glyph's data is first requested do we load in the full font details.

We should update FontCollection so that when you cal install with a file path then instead of loading all the glyph data up front then instead load in the data using the FileFontInstance class so lazy load it instead, thus you can new up a font collection and on startup load all your fonts into the collection with a reduced overhead and only load in the full glyphs data as required,

Support for RTL text

Add option to text layout engine to support rendering 'right to left' instead of the current 'left to right'.

This will require new option on RendererOptions to allow configuring 'right to left`
and updating

public ImmutableArray<GlyphLayout> GenerateLayout(string text, RendererOptions options)
to layout the characters in the corrent 'right to left' style.

Tab Inconsistencies

When the TabWidth is set to 0, any line containing a tab will be cut off following the tab.

When the TabWidth is greater than 1, the actual drawn TabWidth will be 1 too small.

Measuring strings starting or ending with a tab ignores those tabs.

Measuring the string "x\tx" in a monospaced font returns a width of 4 characters when the TabWidth is 4, so the tab seems to be 2 spaces too short. Measuring "x\t\tx" returns a width of 8 characters, so it seems like one of the tabs has the correct width.

Extend TextMeasurer to allow measure character bounds.

Use case: for text editing in a UI the character bounds are needed so when a user clicks somewhere in a text string, the cursor can be shown at the correct character position.

The goal is to provide functionality similar to System.Drawing.Graphics.MeasureCharacterRanges():

            Graphics measureGraphics = DrawUtil.MeasureGraphics;

            // Measure character by character.
            CharacterRange[] characterRanges = new CharacterRange[text.Length];
            for (int i = 0; i < text.Length; ++i) {
                characterRanges[i] = new CharacterRange(i, 1);
            }
            // Set string format.
            StringFormat stringFormat = new StringFormat(StringFormat.GenericTypographic);
            stringFormat.FormatFlags |= StringFormatFlags.NoWrap | StringFormatFlags.MeasureTrailingSpaces;
            stringFormat.SetMeasurableCharacterRanges(characterRanges);
            Region[] regions = 
                measureGraphics.MeasureCharacterRanges(text, basicFont.Font, Rectangle.Empty, stringFormat);
            if (regions.Length > 0) {
                for (int i = 0; i < regions.Length; ++i) {
                    Region region = regions[i];
                    RectangleF bounds = region.GetBounds(measureGraphics);
                    region.Dispose();
                    result = new Vector2D(bounds.Right, 0);
                    characterAdvances.Add(result);
                }
            }
            stringFormat.Dispose();

I've already implemented it locally, see attached TextMeasurer adaptation.

// Licensed under the Apache License, Version 2.0.

using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Numerics;
using SixLabors.Primitives;

namespace SixLabors.Fonts
{
    /// <summary>
    /// Encapulated logic for laying out and measuring text.
    /// </summary>
    public static class TextMeasurer
    {
        private static readonly RectangleF?[] EmptyRectangleFArray = new RectangleF?[0];

        /// <summary>
        /// Measures the text.
        /// </summary>
        /// <param name="text">The text.</param>
        /// <param name="options">The style.</param>
        /// <returns>The size of the text if it was to be rendered.</returns>
        public static SizeF Measure(string text, RendererOptions options)
            => TextMeasurerInt.Default.Measure(text, options);

        /// <summary>
        /// Measures the text.
        /// </summary>
        /// <param name="text">The text.</param>
        /// <param name="options">The style.</param>
        /// <returns>The size of the text if it was to be rendered.</returns>
        public static RectangleF MeasureBounds(string text, RendererOptions options)
            => TextMeasurerInt.Default.MeasureBounds(text, options);

        /// <summary>
        /// Measures the character bounds of the text. For each control character the list contains a <c>null</c> element.
        /// </summary>
        /// <param name="text">The text.</param>
        /// <param name="options">The style.</param>
        /// <param name="characterBounds">The list of character bounds of the text if it was to be rendered. The list may contain <c>null</c> entries.</param>
        /// <returns>Whether any of the characters had non-empty bounds.</returns>
        public static bool MeasureCharacterBounds(string text, RendererOptions options, out IList<RectangleF?> characterBounds)
            => TextMeasurerInt.Default.MeasureCharacterBounds(text, options, out characterBounds);

        internal static SizeF GetSize(ImmutableArray<GlyphLayout> glyphLayouts, Vector2 dpi)
        {
            if (glyphLayouts.IsEmpty)
            {
                return Size.Empty;
            }

            float left = glyphLayouts.Min(x => x.Location.X);
            float right = glyphLayouts.Max(x => x.Location.X + x.Width);

            // location is bottom left of the line
            float top = glyphLayouts.Min(x => x.Location.Y - x.LineHeight);
            float bottom = glyphLayouts.Max(x => x.Location.Y - x.LineHeight + x.Height);

            Vector2 topLeft = new Vector2(left, top) * dpi;
            Vector2 bottomRight = new Vector2(right, bottom) * dpi;

            var size = bottomRight - topLeft;
            return new RectangleF(topLeft.X, topLeft.Y, size.X, size.Y).Size;
        }

        internal static RectangleF GetBounds(ImmutableArray<GlyphLayout> glyphLayouts, Vector2 dpi)
        {
            if (glyphLayouts.IsEmpty)
            {
                return RectangleF.Empty;
            }

            bool hasSize = false;

            float left = int.MaxValue;
            float top = int.MaxValue;
            float bottom = int.MinValue;
            float right = int.MinValue;

            for (var i = 0; i < glyphLayouts.Length; i++)
            {
                var c = glyphLayouts[i];
                if (!c.IsControlCharacter)
                {
                    hasSize = true;
                    var box = c.BoundingBox(dpi);
                    if (left > box.Left)
                    {
                        left = box.Left;
                    }
                    if (top > box.Top)
                    {
                        top = box.Top;
                    }
                    if (bottom < box.Bottom)
                    {
                        bottom = box.Bottom;
                    }
                    if (right < box.Right)
                    {
                        right = box.Right;
                    }
                }
            }

            if (!hasSize)
            {
                return RectangleF.Empty;
            }

            var width = right - left;
            var height = bottom - top;

            return new RectangleF(left, top, width, height);
        }

        internal static bool GetCharacterBounds(ImmutableArray<GlyphLayout> glyphLayouts, Vector2 dpi, out IList<RectangleF?> characterBounds)
        {
            bool hasSize = false;
            if (glyphLayouts.IsEmpty)
            {
                characterBounds = EmptyRectangleFArray;
                return hasSize;
            }

            characterBounds = new List<RectangleF?>();

            for (var i = 0; i < glyphLayouts.Length; i++) {
                var c = glyphLayouts[i];
                if (c.IsControlCharacter)
                {
                    characterBounds.Add(null);
                }
                else
                {
                    hasSize = true;
                    var box = c.BoundingBox(dpi);
                    characterBounds.Add(box);
                }
            }

            return hasSize;
        }

        internal class TextMeasurerInt
        {
            internal static TextMeasurerInt Default { get; set; } = new TextMeasurerInt();

            private TextLayout layoutEngine;

            internal TextMeasurerInt(TextLayout layoutEngine)
            {
                this.layoutEngine = layoutEngine;
            }

            /// <summary>
            /// Initializes a new instance of the <see cref="TextMeasurerInt"/> class.
            /// </summary>
            internal TextMeasurerInt()
            : this(TextLayout.Default)
            {
            }

            /// <summary>
            /// Measures the text.
            /// </summary>
            /// <param name="text">The text.</param>
            /// <param name="options">The style.</param>
            /// <returns>The size of the text if it was to be rendered.</returns>
            internal RectangleF MeasureBounds(string text, RendererOptions options)
            {
                ImmutableArray<GlyphLayout> glyphsToRender = this.layoutEngine.GenerateLayout(text, options);

                return GetBounds(glyphsToRender, new Vector2(options.DpiX, options.DpiY));
            }

            /// <summary>
            /// Measures the text.
            /// </summary>
            /// <param name="text">The text.</param>
            /// <param name="options">The style.</param>
            /// <returns>The size of the text if it was to be rendered.</returns>
            internal bool MeasureCharacterBounds(string text, RendererOptions options, out IList<RectangleF?> characterBounds) {
                ImmutableArray<GlyphLayout> glyphsToRender = this.layoutEngine.GenerateLayout(text, options);

                return GetCharacterBounds(glyphsToRender, new Vector2(options.DpiX, options.DpiY), out characterBounds);
            }

            /// <summary>
            /// Measures the text.
            /// </summary>
            /// <param name="text">The text.</param>
            /// <param name="options">The style.</param>
            /// <returns>The size of the text if it was to be rendered.</returns>
            internal SizeF Measure(string text, RendererOptions options)
            {
                ImmutableArray<GlyphLayout> glyphsToRender = this.layoutEngine.GenerateLayout(text, options);

                return GetSize(glyphsToRender, new Vector2(options.DpiX, options.DpiY));
            }
        }
    }
}```

Mac error: Invalid glyph format, only TTF glyph outlines supported.

Trying to get any font from the system collection results in the above error on a Mac. Windows is working fine. e.g.

using System;
using SixLabors.Fonts;

namespace TestSixLaborsFont
{
class Program
{
static void Main(string[] args)
{
try
{
FontFamily family = FontCollection.SystemFonts.Find("Arial");
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
}
}

SixLabors.Fonts.Exceptions.InvalidFontFileException: Invalid glyph format, only TTF glyph outlines supported.
at SixLabors.Fonts.FontReader..ctor(Stream stream, TableLoader loader)
at SixLabors.Fonts.FontDescription.LoadDescription(String path)
at SixLabors.Fonts.FileFontInstance..ctor(String path)
at SixLabors.Fonts.SystemFontCollection.<>c.<.ctor>b__1_3(String x)
at System.Linq.Enumerable.SelectEnumerableIterator2.MoveNext() at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable1 source, Int32& length)
at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
at SixLabors.Fonts.SystemFontCollection..ctor()
at SixLabors.Fonts.FontCollection.<>c.<.cctor>b__15_0()
at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue()
at TestSixLaborsFont.Program.Main(String[] args) in .../TestSixLaborsFont/Program.cs:line 12

Font Hinting

Provide a mechanism for processing the font hints.

Method not found.

So I am doing image.DrawText();
and I get this exception from some reason,
Exception: Method not found: 'Void SixLabors.Fonts.IGlyphRenderer.BeginGlyph(SixLabors.Primitives.RectangleF)'.

I used breakpoints and it runs fine until DrawText(). I am not sure how I would solve this issue.

Support Brazilian portuguese accents

I have an issue when i use words with accents on azure app service.

When i use word with accent, like á é í ó ú ç ã õ, i receive an error:
Object reference not set to an instance of an object

i try to use font family like Arial and Comic Sans, and problem still happen.

if i remove all accents, all error desapear.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.