Skip to content

Conversation

@MattHeffron
Copy link
Contributor

@MattHeffron MattHeffron commented Dec 1, 2025

This should complete the changes for the MEDLEYDISPLAYFONTFORMAT.
The building a composite font from BDF files implemented.

Resolves #2313
Resolves #2365
This should make #2364 possible.
(I created a size 20 Noto Sans composite font from the same Google fonts as used by @hjellinek's HTMLSTREAM.)

Added files with version of partial implementation of this for old (STRIKE) file format to obsolete/lispusers/READ-BDF-old/

Various renaming for consistency with XCCS -> MCCS changes.
Use IL:FONTSPEC record instead of using FIRST, SECOND, etc.
Fix the parsing of IL:FONTSPEC to use COMPRESSED instead of incorrect CONDENSED.
Zero-width "image" with zero-width "escapement" GLYPHS get put into NOMAPPINGCHARSET.
Add (FILES (SYSLOAD) SYSEDIT) under existing (DECLARE: EVAL@COMPILE DONTCOPY ...)
WRITE-BDF-TO-DISPLAYFONT-FILES is deprecated (but symbols imported from IL: only for use there are not yet removed from :IMPORT-FROM)
Removed WRITE-BDF-TO-DISPLAYFONT-FILE (i.e., no STRIKE format files).
No multiple-values returned. Instead, use LIST when appropriate.
BDF-TO-CHARSETINFO is now IDEMPOTENT w.r.t. the GLYPHS.
Move resolution and defaulting of FAMILY, FACE, SIZE, ROTATION, DEVICE from WRITE-BDF-TO-MEDLEYDISPLAYFONT-FILE to BDF-TO-FONTDESCRIPTOR.
Keep the MCCS chars present BITMAP in the BDF-FONT structure, instead of needing to schlepping it around separately.
Abstracted testing/setting the MCCS chars present bits to CHAR-PRESENT-BIT (mimicking BITMAPBIT).
Added COUNT-MCHARS to know how many MCCS chars are marked in the BITMAP as present.
READ-BDF now handles when UTOMCODE? returns multiple mappings, and creates the appropriate duplicate GLYPHS with different MCCS char codes.
READ-GLYPH doesn't create an empty BITMAP for spacing glyphs.

Use font code changes:
Set (CHARSETINFO CHARSETNO).
Set (FONTDESCRIPTOR FONTSLUGWIDTH).
@MattHeffron MattHeffron self-assigned this Dec 1, 2025
@MattHeffron MattHeffron added the enhancement New feature or request label Dec 1, 2025
@rmkaplan
Copy link
Contributor

rmkaplan commented Dec 1, 2025

Can you include one of the medleyfonts that you are now producing?

@MattHeffron
Copy link
Contributor Author

Here are 2 font files, and PDFs of FontSampler of the fonts. (Zipped so github will accept them.)
bdf derived medleydisplayfonts.zip

Changed parameters for BUILD-COMPOSITE to simplify, and enable keyword :VERBOSE parameter.
Added some VERBOSE progress messages.
@rmkaplan
Copy link
Contributor

rmkaplan commented Dec 2, 2025

On the Tedit file:
Paragraph beginning READ-BDF reads.., 2nd sentence, remove "he first is"
Paragraph beginning "The building of" "procedes" → "proceeds"
Pargraph beginning ":FAMILY". FAMILY → ":FAMILY" halfway down. Also, instead of say a list like FONTCREATE, say a FONTSPEC like FONTCREATE. (Are you calling \FONT.CHECKARGS to decode the arguments in the standard way?)

In the notes: it is also unwise to have a hyphen in a family name.

Why do you recommend not putting them in one of the DISPLAYFONTDIRECTORIES? Why do you think they would be lost if Medley is updated, if they have been committed? You might clarify that this warning is for the situation when somebody is creating fonts in their own environment, and not committing them to Medley.

@rmkaplan
Copy link
Contributor

rmkaplan commented Dec 2, 2025

The only thing I saw in the font files is that the FONTCHARENCODING property should be MCCS, not e.g. NOTOSANS. Is that coming from \READCHARSET or from your own function?

@pamoroso
Copy link
Contributor

pamoroso commented Dec 2, 2025

I copied the sample font files to medley/fonts/medleydisplayfonts/ and they seem to be working fine in TEdit:

bdf-fonts

Copy link
Member

@masinter masinter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think moving the old versions of READ-BDF to obsolete/ is a good idea. Old versions are readily available in the git hisstory.

in some cases where we're depricating old software and we're not quite sure of the deprecation it might be OK but that doesn't apply here.

@MattHeffron
Copy link
Contributor Author

MattHeffron commented Dec 2, 2025

The only thing I saw in the font files is that the FONTCHARENCODING property should be MCCS, not e.g. NOTOSANS. Is that coming from \READCHARSET or from your own function?

It's not in my code. I don't call \READCHARSET.

It looks like it is in FNS FONTPROP:

;; Under (SELECTQ
  (CHARENCODING [OR (ffetch FONTCHARENCODING of FONT)
                    (freplace FONTCHARENCODING of FONT
                       with (if (MEMB (fetch (FONTDESCRIPTOR FONTFAMILY) of FONT)
                                      NSFONTFAMILIES)
                                then 'XCCS$
                              elseif (MEMB (fetch (FONTDESCRIPTOR FONTFAMILY) of FONT)
                                           ALTOFONTFAMILIES)
                                then 'ALTOTEXT
                              else (fetch (FONTDESCRIPTOR FONTFAMILY) of FONT])

that last else is defaulting to the FAMILY.

(This needs regression tests. "Harmless" edits aren't!)
Documentation review changes.
@MattHeffron
Copy link
Contributor Author

@rmkaplan
Made the Tedit changes.
(I'm open to wordsmithing suggestions for the DISPLAYFONTDIRECTORIES note.)

No, I don't use \FONT.CHECKARGS because there is an extra intermediate level of defaulting from within the BDF-FONT (the XLFD ("X Logical Font Description" within the .bdf file)

@MattHeffron
Copy link
Contributor Author

I don't think moving the old versions of READ-BDF to obsolete/ is a good idea.

Removed.

@pamoroso
Copy link
Contributor

pamoroso commented Dec 3, 2025

I updated to commit c25da55 and it's still working with no issues.

@pamoroso
Copy link
Contributor

pamoroso commented Dec 5, 2025

I updated to commit d2b1726, still no issues.

@MattHeffron
Copy link
Contributor Author

@rmkaplan
I just made CHARSETENCODING and FONTCHARENCODING values of CHARSETINFO and FONTDESCRIPTOR, respectively, explicitly be MCCS

@pamoroso
Copy link
Contributor

pamoroso commented Dec 9, 2025

I updated to commit 2effafc and the test fonts still work.

@MattHeffron
Copy link
Contributor Author

I updated to commit 2effafc and the test fonts still work.

@pamoroso This change wouldn't have affected fonts already created from BDF, but only newly created ones. (And, even at that, the changes were only for internal correctness; as shown by the fact that the fonts previously created already worked correctly.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

READ-BDF should be able to build a single FONTDESCRIPTOR from a sequence of BDF fonts READ-BDF need to be updated for new MEDLEYDISPLAYFONT format

5 participants