External Publication
Visit Post

Community Bonding + Week 1 Status Update | GSoC '26

Planet KDE [Unofficial] June 4, 2026
Source

Hello Reader!

In case you don't know me (quite likely ๐Ÿ˜†), I am Ojas Maheshwari (@the_epicman:matrix.org) and I am currently working in the Google Summer of Code program for the KDE community on a project about Font Subsetting in Poppler under my mentor Albert Astals Cid.

Community Bonding

If I am being honest, I had already bonded with the Poppler community before GSoC started ๐Ÿ˜…

I had a lot of conversations with Albert, Sune, lbaudin and ats, and they already helped me a lot with my technical problems with my contributions prior to GSoC :D

However, I also managed to bond with other fellow GSoC contributors this summer so it's a win in my book :D

Week 1

I learnt a lot about how PDF files work this week.

Technical terms like Indirect Objects, Default Appearance, Appearance Streams which used to sound confusing to me before finally clicked.

I got more comfortable with traversing and using PDF data structures such as Objects, Arrays, Dicts, Streams etc.

The Happy News is that I got the Font Subsetting to work for FreeText Annotations.

I have raised a Draft MR which should be ready-to-review by end of this week and my plan is to get it fully correct and merged first and then move on to doing the same thing for forms.

Code screenshot to make the blog look cooler

How it works

If you are interested to know what my current approach is:

  • The whole subsetting runs only when the user saves the document.

  • We go over all resources (for now, just FreeText annotations) that were modified, and call a subsetFonts method on them.

  • This is a method implemented by every class that needs subsetting, and inside this method we pass the data on what "font" renders what part of the "text" to our FontSubsetter::getSubsetFonts.

    std::map<Ref, Ref> FontSubsetter::getSubsetFonts(const std::map<std::shared_ptr, std::string> &fontMappings) const

  • The function generates the subset font objects and adds them to the PDF and returns mappings of old font refs and newer font refs. The subsetting happens using a library called "Harfbuzz".

  • Then the subsetFonts function simply replaces the older refs with the newer ones inside the font subdictionary of the appearance stream of the annotation.

Thanks for reading

Although this blog might look small, it took me more than 1.5 hours to write this because I kept writing and deleting things. I am hoping I get better at writing blogs in the future.

But anyways, thanks for reading! And have a great day ! Byee ๐Ÿ˜ƒ!

Discussion in the ATmosphere

Loading comments...