[Feature Request] draw font% does not expose kerning
Nobody has claimed this yet.
- Dominant language
- Racket
- Stars
- 19
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
Is your feature request related to a problem? Please describe.
It is not possible to draw the letters "V" and "A" correctly next to each other, because the library racket/draw does not expose the kerning table of a font.
Describe the solution you'd like
I would like to have a function, which returns the kerning similar to kerning-value of "sfont".
It would be nice to have a function, which calculates the kerning between two strings or characters. It seems to me that currently this is the only way to calculate the kerning between two strings:
#lang racket/gui
(define font (make-font #:size 16 #:face "Latin Modern Roman"))
(define frame (new frame% [label ""]))
(define canvas (new canvas% [parent frame]))
(define dc (send canvas get-dc))
(define left "A")
(define right "V")
(define both (string-append left right))
(define-values (left-text-width left-text-height left-baseline-height left-extra-height)
(send dc get-text-extent left font #t))
(values left-text-width left-text-height left-baseline-height left-extra-height)
(printf "\n")
(define-values (right-text-width right-text-height right-baseline-height right-extra-height)
(send dc get-text-extent right font #t))
(values right-text-width right-text-height right-baseline-height right-extra-height)
(printf "\n")
(define-values (both-text-width both-text-height both-baseline-height both-extra-height)
(send dc get-text-extent both font #t))
(values both-text-width both-text-height both-baseline-height both-extra-height)
(printf "\n")
(- (+ left-text-width right-text-width)
both-text-width)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the racket/draw documentation and the existing get-text-extent and make-font entry points. Compare the requested behavior with sfont's kerning-value API and determine how kerning should be exposed for characters or strings. Done means the draw API provides the requested kerning information and documents its behavior.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, desktop
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100