Comments (3)
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.
Hi. There were two things I was trying to achieve:
- An outline effect to some letters.
- 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.
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)
- Incorrect nuget package QuestPDF 2024.3.0-rc2
- QuestPDF.Previewer 2024.3.0-rc and .NET8 - can't install package HOT 1
- QuestPDF.Drawing.Exceptions.DocumentDrawingException: 'Could not find an appropriate font fallback for the following glyphs: $U-000D ' HOT 16
- Devanagari font rendering Issue Linux HOT 4
- Non-PageBreaking cell of table duplicates data in both pages HOT 2
- Nuget should buildTransitive instead of build for the QuestPDF.targets HOT 2
- Everything stop working correctly after upgrading to latest version HOT 3
- Canvas Deprecated? HOT 2
- unable to load dll 'questpdfskia' on Windows 11 .NET Framework C#
- Rounded corners for borders HOT 2
- SVG: Classes in CSS have no effect. HOT 1
- Black border using SkiaSharp canvas integration HOT 4
- FitArea, FitWidth, FitHeight don't work for SVG images HOT 7
- Allow the pdf to be exported as clean html & css. HOT 1
- Is there any APIs can draw arbitrary line by 2 points?
- QuestPDFSkia DLL is not detected as a dependency. HOT 1
- Calling FontManager.RegisterFont throws an InitializationException HOT 2
- Sporadic AccessViolationException when UseEnvironmentFonts is false and documents are generated in parallel HOT 2
- Lato font is not included in platform-specific builds HOT 2
- Font rendering (line-height) in 2024.3.X HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from questpdf.