Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<Intial> glyph placement / leading encroaches on surrounding text with mode=harfbuzz, bidi=yes direction=rtl #287

webservant316 opened this issue Dec 16, 2020 · 6 comments


Copy link

See page #1, Hebrew example at
See layout.xml at
See configurations at

Worse examples also observed in my production environment

@pgundlach pgundlach added the Feedback needed User feedback is required to keep this issue open label Dec 17, 2020
Copy link

Could you please make a short test file for the problem? I have all fonts here, I just need the data and input.

Copy link

Copy link

I can't see what is wrong and what you'd expect instead. Perhaps a picture might help?

Copy link

See failed use of in attached PDF. See the glyph in the overlaps surrounding text below the

Pages from Holy-Bible---Arabic---Arabic-Van-Dyck-Bible---Aionian-Edition.pdf

Had trouble illustrating with a small example to produce same effect. However, my entire package for produce the PDF documents is found at

@pgundlach pgundlach added Question / Support Needs investigation Needs further research before taking action Bug and removed Feedback needed User feedback is required to keep this issue open Question / Support Needs investigation Needs further research before taking action labels Dec 18, 2020
@pgundlach pgundlach assigned pgundlach and unassigned webservant316 Dec 18, 2020
@pgundlach pgundlach added this to the Version 4.2 milestone Dec 18, 2020
Copy link

Initial placement is pure luck currently in speedata.


<?xml version="1.0" encoding="UTF-8"?>
<Layout xmlns="" xmlns:sd="urn:speedata:2009/publisher/functions/en">
	<LoadFontfile mode="harfbuzz" name="amiri" filename="amiri-regular.ttf" />

	<DefineFontfamily name="text" fontsize="10" leading="12">
		<Regular fontface="amiri" />

	<DefineFontfamily name="init" fontsize="24" leading="24">
		<Regular fontface="amiri" />

	<!-- DEFINE PAGES -->
	<SetGrid width="4.5pt" height="4.5pt" />

	<Pagetype name="t" test="true()">
		<Margin left="0.25in" right="0.25in" top="0.25in" bottom="0.25in" />
		<PositioningArea name="area2col">
			<PositioningFrame row="1" column="1" width="43" height="132" />
			<PositioningFrame row="1" column="46" width="43" height="132" />

	<Record element="chapter">
		<Output area="area2col">
				<Paragraph language='Other' bidi="yes" direction="rtl">
					<Initial fontfamily="init" padding-right="2pt">
					<Value select="." />
<?xml version='1.0' encoding='utf-8'?>
<chapter CHAP='١'>
    <span class='vn' V='1' VN='١'> ١</span>
    <span class='v'>فِي ٱلْبَدْءِ خَلَقَ ٱللهُ ٱلسَّمَاوَاتِ وَٱلْأَرْضَ.</span>
    <span class='vn' V='2' VN='٢'> ٢</span>
    <span class='v'>وَكَانَتِ ٱلْأَرْضُ خَرِبَةً وَخَالِيَةً، وَعَلَى وَجْهِ ٱلْغَمْرِ ظُلْمَةٌ، وَرُوحُ ٱللهِ يَرِفُّ عَلَى وَجْهِ ٱلْمِيَاهِ.</span>
    <span class='vn' V='3' VN='٣'> ٣</span>
    <span class='v'>وَقَالَ ٱللهُ: «لِيَكُنْ نُورٌ»، فَكَانَ نُورٌ.</span>
    <span class='vn' V='4' VN='٤'> ٤</span>
    <span class='v'>وَرَأَى ٱللهُ ٱلنُّورَ أَنَّهُ حَسَنٌ.  وَفَصَلَ ٱللهُ بَيْنَ ٱلنُّورِ وَٱلظُّلْمَةِ.</span>
    <span class='vn' V='5' VN='٥'> ٥</span>
    <span class='v'>وَدَعَا ٱللهُ ٱلنُّورَ نَهَارًا، وَٱلظُّلْمَةُ دَعَاهَا لَيْلًا.  وَكَانَ مَسَاءٌ وَكَانَ صَبَاحٌ يَوْمًا وَاحِدًا.</span>
    <span class='vn' V='6' VN='٦'> ٦</span>
    <span class='v'>وَقَالَ ٱللهُ: «لِيَكُنْ جَلَدٌ فِي وَسَطِ ٱلْمِيَاهِ.  وَلْيَكُنْ فَاصِلًا بَيْنَ مِيَاهٍ وَمِيَاهٍ».</span>



Copy link

Version 4.1.25 will have this fixed (and more control over padding-top and padding-bottom). This is a non-backward compatible change and will change the appearance of all initials - so please double check that you get the desired output.

The old implementation was just crap and needed a complete rewrite (nothing big, just a different way to move the initial around and to calculate the line height).


Thank you as always for the example, the bug report and your patience.

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

No branches or pull requests

2 participants