<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>Ojas Maheshwari&apos;s Blog Site</title>
<link>https://ojasmaheshwari.github.io</link>
<description>&lt;p&gt;Hi, I am Ojas Maheshwari&lt;br&gt;I am a C++ programmer and currently a college student.&lt;/p&gt;&lt;p&gt;I am a GSoC contributor at KDE right now.&lt;br&gt;I shall document my learnings and my journey through this blog feed.&lt;br&gt;I might also occasionally add some tech articles about other things when I feel like it.&lt;/p&gt;&lt;p&gt;You can reach out to me at workonlyojas@gmail.com if you feel like it.&lt;/p&gt;&lt;p&gt;Thanks for reading :D&lt;/p&gt;</description>
<lastBuildDate>Mon, 22 Jun 2026 14:16:07 +0000</lastBuildDate>
<item>
<title>Introductory Blog</title>
<link>https://ojasmaheshwari.github.io/b/2026/introductory-blog</link>
<description>Hi, I am Ojas Maheshwari. This is an introduction post/blog so that I know the site works correctly!</description>
<content:encoded><![CDATA[<p>Hello, I am Ojas Maheshwari.</p>
<p>I am a C++ engineer who is currently writing code for KDE community for GSoC '26.<!-- raw HTML omitted -->
My project involves performing &quot;font subsettting&quot; on a PDF rendering library called Poppler which Okular (KDE's Universal PDF Viewer uses).</p>
<p>This site will contain general blogs as well as the official documentation and progress updates on what I did through the whole journey including:</p>
<ul>
<li>My approach and plan.</li>
<li>The problems I faced and how I solved them.</li>
<li>My thinking process wherever possible.</li>
</ul>
<p>This is an introductory page to see if the site works correctly. <!-- raw HTML omitted -->
Thanks :D</p>
]]></content:encoded>
<author>Ojas Maheshwari</author>
<guid isPermaLink="true">https://ojasmaheshwari.github.io/b/2026/introductory-blog</guid>
<pubDate>Sun, 24 May 2026 15:12:09 +0000</pubDate>
</item>
<item>
<title>Community Bonding + Week 1 Status Update | GSoC &apos;26</title>
<link>https://ojasmaheshwari.github.io/b/2026/community-bonding-week-1-status-update-gsoc-26</link>
<description>This blog is about sharing whatever work I did and completed in the community bonding period and week 1 of my GSoC at KDE Community.</description>
<content:encoded><![CDATA[<p>Hello Reader!</p>
<p>In case you don't know me (quite likely 😆), I am Ojas Maheshwari (@the_epicman:matrix.org) and I am currently working in the <a href="https://summerofcode.withgoogle.com/">Google Summer of Code</a> program for the KDE community on a project about Font Subsetting in <a href="https://gitlab.freedesktop.org/poppler/poppler">Poppler</a> under my mentor Albert Astals Cid.</p>
<h2>Community Bonding</h2>
<p>If I am being honest, I had already bonded with the Poppler community before GSoC started 😅</p>
<p>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</p>
<p>However, I also managed to bond with other fellow GSoC contributors this summer so it's a win in my book :D</p>
<h2>Week 1</h2>
<p>I learnt a lot about how PDF files work this week.</p>
<p>Technical terms like Indirect Objects, Default Appearance, Appearance Streams which used to sound confusing to me before finally clicked.</p>
<p>I got more comfortable with traversing and using PDF data structures such as Objects, Arrays, Dicts, Streams etc.</p>
<p>The Happy News is that I got the Font Subsetting to work for FreeText Annotations.</p>
<p>I have raised a <a href="https://gitlab.freedesktop.org/poppler/poppler/-/merge_requests/2220">Draft MR</a> 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.</p>
<p><img src="https://ojasmaheshwari.github.io/assets/blog_week1_ss.png" width="1200" height="auto" alt="A picture of my IDE containing my work"><br>
<i>Code screenshot to make the blog look cooler</i></p>
<h2>How it works</h2>
<p>If you are interested to know what my current approach is:</p>
<ul>
<li>
<p>The whole subsetting runs only when the user saves the document.</p>
</li>
<li>
<p>We go over all resources (for now, just FreeText annotations) that were modified, and call a <code>subsetFonts</code> method on them.</p>
</li>
<li>
<p>This is a method implemented by every class that needs subsetting, and inside this method we pass the data on what &quot;font&quot; renders what part of the &quot;text&quot; to our <code>FontSubsetter::getSubsetFonts</code>.</p>
</li>
</ul>
<pre><code>std::map&lt;Ref, Ref&gt; FontSubsetter::getSubsetFonts(const std::map&lt;std::shared_ptr&lt;const GfxFont&gt;, std::string&gt; &amp;fontMappings) const
</code></pre>
<ul>
<li>
<p>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 &quot;Harfbuzz&quot;.</p>
</li>
<li>
<p>Then the <code>subsetFonts</code> function simply replaces the older refs with the newer ones inside the font subdictionary of the appearance stream of the annotation.</p>
</li>
</ul>
<h2>Thanks for reading</h2>
<p>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.</p>
<p>But anyways, thanks for reading!<br>
And have a great day !<br>
Byee 😃!</p>
]]></content:encoded>
<author>Ojas Maheshwari</author>
<guid isPermaLink="true">https://ojasmaheshwari.github.io/b/2026/community-bonding-week-1-status-update-gsoc-26</guid>
<pubDate>Thu, 04 Jun 2026 17:39:41 +0000</pubDate>
</item>
<item>
<title>Week 2 + Week 3: Dangling pointer bugs, silly mistakes and a lot of CMake</title>
<link>https://ojasmaheshwari.github.io/b/2026/week-2-week-3-dangling-pointer-bugs-silly-mistakes-and-a-lot-of-cmake</link>
<description>This blog covers progess and work done in week 2 and week 3 of my GSoC project about Font Subsetting in Poppler.</description>
<content:encoded><![CDATA[<p>Hey wassup guys! Welcome to yet another blog made by me!</p>
<p>I've been busy for a while due to exam stress and my passport situation.<br>
But I am glad to share that I finally got the passport yesterday! This brings me one step closer to making it to <strong>Akademy 2026</strong> in Graz, Austria.<br>
<br>
Now I just need to get my flight and hotel bookings done, get some required documents signed from my university, get a VISA or a forex card and then finally apply for the Austrian Schengen VISA.<br>
<br>
Anyways, this blog is supposed to be about sharing learnings / progress made in week 2 and 3 of my GSoC journey so let's go!
<br></p>
<p>If I recall correctly, I did the following in the past 2 weeks:</p>
<h3>Work on some CI issues in the android image and the windows MinGW image.</h3>
<ul>
<li>I had to build harfbuzz from scratch for the android image because it simply didn't have it by default.</li>
<li>For the windows image, I actually found a bug in harfbuzz which made the windows build fail. I filed an issue and they fixed it very quickly by using AI https://github.com/harfbuzz/harfbuzz/issues/6026. I don't really like it myself that harfbuzz is heavily using AI in its development but I think I can't really do much about it. Perhaps this is a topic worth covering in another blog?</li>
</ul>
<h3>Destroying resources after we have no use for them.</h3>
<ul>
<li>I was leaking some memory by using harfbuzz to generate subset fonts but was never really calling the destroy functions required to free that memory.</li>
</ul>
<h3>Fix a dangling pointer bug that caused invalid fonts on subsetting.</h3>
<ul>
<li>I unknowingly made a serious <i>dangling pointer</i> or <i>use after free</i> bug when I was working on destroying harfbuzz resources after I had used them. The gist here was that I used a class called <code>MemStream</code> but didn't realize that it actually had a read-only view on my  subset font data, let's say <code>const char* fontData</code>. I called harfbuzz destroy function after constructing this stream and it freed the <code>fontData</code> and then when the time came for writing to the file, the <code>fontData</code> pointer inside the stream was dangling and corrupted data got written.</li>
</ul>
<h3>Making font subsetting an optional feature</h3>
<ul>
<li>I reported the harfbuzz issue and the patch MR got merged so does that mean the windows CI would also get fixed immediately? Not quite, the harfbuzz people would first need to <i>release a release</i> and then it needs to be updated in the package repository to finally get the patch working. We aren't sure about just how much time this is going to take so I worked on making the font subsetting functionality optional by using CMake options magic.</li>
</ul>
<h2>What I learned</h2>
<ul>
<li>I am now less likely to make dangling pointer mistakes but it could still happen.</li>
<li>Quite a lot of CMake and how to do optional features with it.</li>
<li>Dealing with CI.</li>
<li>And a couple more things I forgot about but I did actually learn from them.</li>
</ul>
<h2>Conclusion</h2>
<p>I think I did like below-okayish amount of work done but I am glad I actually learnt a lot of useful and important things.<br>
<br>
I would like to thank my mentor Albert Astals Cid, and the Poppler community for helping me.
I would also like to thank KDE board members for approving my reimbursement requests.<br>
<br>
And finally, thank you for reading my blog so far :)</p>
<p>Until next time!</p>
]]></content:encoded>
<author>Ojas Maheshwari</author>
<guid isPermaLink="true">https://ojasmaheshwari.github.io/b/2026/week-2-week-3-dangling-pointer-bugs-silly-mistakes-and-a-lot-of-cmake</guid>
<pubDate>Mon, 22 Jun 2026 14:16:07 +0000</pubDate>
</item>
</channel>
</rss>
