GithubHelp home page GithubHelp logo

Comments (3)

MarcinZiabek avatar MarcinZiabek commented on May 8, 2024

Hello 😁 What requirement exactly are you trying to accomplish? Is there any text-style feature missing?

Generally speaking, I am against exposing the SkiaSharp dependency. It is coupled within the internal, non-public process that may change on a per release basis. I am looking forward to providing alternative solutions. A better understanding of your problem with help.

from questpdf.

hungnd1475 avatar hungnd1475 commented on May 8, 2024

Hi. There were two things I was trying to achieve:

  1. An outline effect to some letters.
  2. Drawing a symbol in line with the text.

For the first requirement, I needed something similar to SKPaintStyle.Stroke, but it is not possible with the high level TextStyle, so I had to use the lower level SKPaint instead. In addition, I also loaded some custom fonts with FontManager.RegisterFont() to use for the whole file (including the outlined letters), but because I don't have access to the FontManager's internal SKTypeface dictionary, I had to duplicate them as well.

Regarding the second requirement, I'm not sure if there is an alternative way without using SKPaint to draw the text. I tried using Inlined but seems like it doesn't play well with Canvas, so I ended up using Canvas to draw everything (including the text).

I guess we can add a new API to TextStyle to achieve the first requirement, but not sure if it's possible with the second one. So I thought exposing FontManager's internals can at least make creating SKPaint with custom typefaces a little less painful.

from questpdf.

MarcinZiabek avatar MarcinZiabek commented on May 8, 2024

An outline effect to some letters.

I think that the stroke effect has a very minor usage. Therefore it is not available out of the box. Using the Canvas element to generate custom content is a proper approach. If more people require this functionality, I can rethink 😀

Drawing a symbol in line with the text.

This is already supported. Please take a look here. Please note that injected elements do not support line-breaking and need to be visible as a whole block. You can inject everything you want.

from questpdf.

Related Issues (20)

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.