Skip to content

Conversation

@pgundlach
Copy link
Contributor

I think subsetting is valuable for the Lua library, so I started implementing subsetting methods. Perhaps it is useful for the main repository?

I am sure that the code is not optimal and I might be something missing. I'd be happy to get feedback if a) it is of any interest to the luaharfbuzz repo and b) where I can enhance the code.

@deepakjois
Copy link
Collaborator

I am a bit too far removed from this to give a comprehensive review, so will defer to the other maintainers.

It would be good to have some tests along with this functionality if applicable. I also noticed the current tests are failing, but not sure whether it's your change that's causing it.

@khaledhosny
Copy link
Contributor

The subset API should be in a separate Lua module, since not all users (especially LuaTeX) will need the subset API.

@pgundlach
Copy link
Contributor Author

The subset API should be in a separate Lua module, since not all users (especially LuaTeX) will need the subset API.

you mean a different like luaharfbuzz-subset? Same luarock repo but different sub directory?

This module is made especially for LuaTeX, since currently there is no way to use variable fonts with LuaHBTeX.

@khaledhosny
Copy link
Contributor

The subset API should be in a separate Lua module, since not all users (especially LuaTeX) will need the subset API.

you mean a different like luaharfbuzz-subset? Same luarock repo but different sub directory?

Yes.

This module is made especially for LuaTeX, since currently there is no way to use variable fonts with LuaHBTeX.

I think you will need to check with LuaTeX maintainers then if they are OK with the new dependency on he subset library, and probably TeXLive as well as I don’t think they currently build it.

@pgundlach
Copy link
Contributor Author

This module is made especially for LuaTeX, since currently there is no way to use variable fonts with LuaHBTeX.

I think you will need to check with LuaTeX maintainers then if they are OK with the new dependency on he subset library, and probably TeXLive as well as I don’t think they currently build it.

I have done that, and the maintainers encouraged me to do this.

@khaledhosny
Copy link
Contributor

Excellent.

@pgundlach
Copy link
Contributor Author

I will address the issue with the second library in a later commit, I'd like to resolve the other issues first.

Thank you very much for your time reviewing this.

@khaledhosny
Copy link
Contributor

Looks good now. Other than the two standing minor issues, this needs some tests and documentation needs to be updated.

@pgundlach
Copy link
Contributor Author

I am not sure if the lua file in the src-subset makes sense or if it should be placed in a different directory. Currently it is a stub only, but might be extended in the future.

incdirs = {"$(HARFBUZZ_INCDIR)/harfbuzz"},
libdirs = {"$(HARFBUZZ_LIBDIR)"}
},
luaharfbuzzsubset = {
Copy link
Contributor

Choose a reason for hiding this comment

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

So we now have two separate libraries? I don’t mind either way, though I though we decided earlier to keep it as one library.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I understand the comment at #65 (comment) "The subset API should be in a separate Lua module, since not all users (especially LuaTeX) will need the subset API." in a way that two libraries should be created.

One would be easier to deploy of course. I wouldn't mind to merge both into one library.

Copy link
Contributor

Choose a reason for hiding this comment

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

I’m OK with it this way. We can change it later if, say, integration in TeX Live turned out to be harder. I took the opportunity to fix a few notpicks that I commented about. I have one more nitpick to fix and this should be ready.

@khaledhosny
Copy link
Contributor

I think I’m happy with the current state. Please take a look and let me know if it is OK with you as well and I’ll merge it.

@pgundlach
Copy link
Contributor Author

I think I’m happy with the current state. Please take a look and let me know if it is OK with you as well and I’ll merge it.

This is really great. Thank you so much for the excellent work!

@khaledhosny khaledhosny merged commit 2e0e408 into harfbuzz:main Nov 28, 2025
2 checks passed
@pgundlach pgundlach deleted the feature/subset branch November 28, 2025 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants