be5invis / Iosevka

Versatile typeface for code, from code.
http://be5invis.github.io/Iosevka
SIL Open Font License 1.1
19.27k stars 574 forks source link

Improved documentation that allows a larger audience to contribute #2503

Open raner opened 1 month ago

raner commented 1 month ago

Is your feature request related to a problem? Please describe. Clearly, Iosevka is a popular project that is enjoyed by many people for numerous reasons. However, other than @be5invis, @jmcwilliams403, and maybe a handful of other folks, the group of contributors is relatively small. Personally, when I open an issue for an open-source project and the issue has been deemed valid, I like to contribute a pull request to solve the issue myself (if I have the time). I would like to do this for Iosevka as well, but unfortunately I cannot really wrap my head around how things are done in this code base. When I look at the PRs for similar issues, I usually end up scratching my head, and I'm often unable to understand how the code in the PR actually solved the problem. I looked at the documentation for the PatEL language, which is fairly straightforward, but clearly there is a lot more to Iosevka than just PatEL.

Describe the solution you'd like I would be delighted to see some more extensive documentation (beyond build set-up, etc.) that explains the philosophy behind the Iosevka code base and explains how to add new characters. I understand that the idea is to reuse geometric primitives so that changes can be applied consistently without the need to edit hundreds of glyphs. However, to the uninitiated it is difficult to understand what primitives should be reused and when possibly a new primitive should be introduced.

For example, it would be very useful if there were some documentation that explained how to achieve the following features:

Before describing such specific tasks, it might be good to outline the general design philosophy of Iosevka (it is very clear that there is one, but it does not seem to be written down anywhere).

Describe alternatives you've considered As a starting point and possible alternative, one could single out some existing past PRs with exceptionally good documentation, or start including some more explanatory notes in PRs that explain why certain problems were solved certain ways.

Additional context Sadly, I've seen many great open-source projects that were sentenced to death once the main contributors moved on to other things (or no longer had the time to maintain the project). Some of these projects even had dozens of committers and still suffered this fate. With Iosevka you can count the committers on one hand, so my feeling is that the project could be at risk long term unless more developers are able to make meaningful contributions. This could also help with reducing the current issue backlog that clearly demonstrates that the interest in Iosevka is larger than what the current group of contributors can maintain.

be5invis commented 1 month ago

Right, I want to do some stabilization work in the next year or so. One key step at current stage could be migrating more stuff from PTL to MJS -- The Iosevka's PTL code relies heavily on macros (for example, [glyph-proc] is a macro), which is not simple to understand.

The problem is, Iosevka is already very complicated -- I guess it is one of the most complicated LGC font project... As a result writing docs for it is not a simple work especially considering I am not an English native speaker.

Logo121 commented 1 month ago

Handful other folks here. I doubt anyone who contributes here (except be5invis himself) has a full idea of what's going on in the code (especially the more complex ones). You can generally do fine by looking at other code and copying/following them, then learning the mechanisms bit by bit.

But here's some basic ideas on how this font works (at least how I perceive it; correct me if I'm wrong):


And for your examples:


As for documented PRs... well I sometimes do a very simple explanation on how I interpreted/implemented some glyphs (e.g. #2190), but definitely not to the level of "using what primitives". The main purpose of those notes are simply for Belleve to review, so I doubt the fine-grained details are really necessary (imo).

Logo121 commented 1 month ago

As for the issue itself, I guess we can use the Discussion feature for matters that don't really qualify as issues so that it's easier to discuss about things like these. Just a thought though.

raner commented 1 month ago

@Logo121 Thanks for taking the time to write down some of your knowledge about the codebase and answering my questions. This is a great start for the documentation that I had in mind!

be5invis commented 1 month ago

A correction is that MarkSets (or DivFrame's markSet's) add base anchors instead of mark anchors. Mark anchors are used by, well, mark/diacritic glyphs. A mark/diacritic glyph could also contain mark anchors, which is used to build mark stacking feature.

DivFrame is an utility object that used to handle X metrics. Usually Y-direction metrics are simple but I could create a new helper to do that...

Autobuild is one of the most obscure part in the build system -- to save glyph IDs, I did a lot of black magic inside them. I want to do a refactor of these...