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

DejuVu font does not contain Chinese or Thai characters - affects Fan Chart and PDF reports #1479

Open
melizaa opened this issue Nov 16, 2017 · 10 comments
Labels
upstream error in a third-party library

Comments

@melizaa
Copy link
Contributor

melizaa commented Nov 16, 2017

I see Thai name for instance in Wife Duangruthai Janmo ‘Jo’ ดวงฤทย จนทรโม ‘โจ’ in pdf reports as boxes in pdf reports.
2017-11-16_13-29-46

@fisharebest
Copy link
Owner

PDF reports use the DejaVu sans font, which does not currently contain Thai letters.

See the section on coverage in https://en.wikipedia.org/wiki/DejaVu_fonts

@fisharebest
Copy link
Owner

Noto sans offers wider coverage - but not in a single .ttf file.

We could attempt to merge various noto files, but there are limits such as the maximum number of glyphs in a file, and different line-heights, etc. for different scripts. More info at notofonts/noto-fonts#13

@fisharebest
Copy link
Owner

Also, noto was designed for screen use (i.e. android phones), rather than print and PDF is aimed at print media.

@vytux-com
Copy link
Contributor

In the above linked issue they mention that Ariel unicode MS has all charts in 1 font file. Why not use that?

@fisharebest
Copy link
Owner

Arial is a proprietory font, owned by Microsoft.

We are not allowed to include it in an open-source project. See https://en.wikipedia.org/wiki/Arial#Distribution

@fisharebest fisharebest changed the title Thai name in PDF reports DejuVi font does not contain Chinese or Thai characters - affects Fan Chart and PDF reports Mar 4, 2019
@fisharebest fisharebest changed the title DejuVi font does not contain Chinese or Thai characters - affects Fan Chart and PDF reports DejuVu font does not contain Chinese or Thai characters - affects Fan Chart and PDF reports Mar 4, 2019
@fisharebest fisharebest added the upstream error in a third-party library label Mar 6, 2021
@ghost
Copy link

ghost commented Jun 5, 2021

@ghost
Copy link

ghost commented Jun 5, 2021

@fisharebest
How are the pdf's created? Can this be changed to use multiple fonts with e.g. fontconfig? Especially as the dejavu-project seems to be not taken care of anymore.

@ghost ghost mentioned this issue Jun 8, 2021
@melizaa
Copy link
Contributor Author

melizaa commented Oct 5, 2021

Not only Chinese and Thai languages print undefined characters or undefined offsets in PDF and HTML reports.
I look now at a Family report in different webtrees languages.

@iyoua
Copy link
Contributor

iyoua commented Jun 9, 2022

@melizaa The Chinese characters in the PDF report are not displayed. Have you solved this problem? I uploaded several font files and modified the file name, but still failed.

@iyoua
Copy link
Contributor

iyoua commented Jun 10, 2022

I downloaded a font and copied it to tcpdf\fonts folder. After modifying the report code, the body of the report is displayed in Chinese, but the report header is always not displayed. I can't find the reason. Even if I change the style to the style of the body, it won't work. Why?
`

<!-- Header -->
<Style name="header" font="$fonts" size="16" style="b" />
<!-- Page numbers text -->
<Style name="pagenum" font="$fonts" size="8"/>
<!-- Standard text -->
<Style name="text" font="$fonts" size="9"/>
<!-- Column labels -->
<Style name="label" font="$fonts" size="10" style="b"/>
<!-- Generated by style - required style name by the generator -->
<Style name="genby" font="$fonts" size="8" />
<!-- Date text -->
<Style name="date" font="$fonts" size="8"/>
<Style name="header2" font="$fonts" size="12" style="b" />

<if condition="$pageorient=='landscape'">
	<!-- landscape orientation -->
	<SetVar name="namewidth" value="270"/>
	<SetVar name="datewidth" value="300"/>
</if>

<if condition="$pageorient=='portrait'">
	<!-- portrait orientation -->
	<SetVar name="namewidth" value="210"/>
	<SetVar name="datewidth" value="190"/>
</if>

<Doc pageSize="$pageSize" orientation="$pageorient" >
	<Header>
		<Cell align="center" height="20" newline="1" style="text"><var var="I18N::translate('Changes')" /></Cell>
		<Cell align="rightrtl" newline="1" style="pagenum"><var var="I18N::translate('Page')" /> <PageNum /> <var var="I18N::translate('of')" /> <TotalPages /></Cell>
	</Header>

	<Body>

		<!-- Pending changes section Header -->
		<if condition="$pending=='yes'">
			<Cell align="center" height="20" newline="1" style="header2"><var var="I18N::translate('Pending changes')" /></Cell>
			<SetVar name="fill" value="" />
			<if condition="$sortby=='NAME'"><SetVar name="fill" value="#AAAAAA" /></if>
			<TextBox bgcolor="$fill" border="1" height="12" width="$namewidth">
				<Text style="label"><var var="I18N::translate('Name')" /></Text>
			</TextBox>

			<TextBox border="1" height="12" width="$datewidth">
				<Text style="label"><var var="I18N::translate('Differences')" /></Text>
			</TextBox>

			<SetVar name="fill" value="" />
			<if condition="$sortby=='CHAN'"><SetVar name="fill" value="#AAAAAA" /></if>
			<TextBox bgcolor="$fill" border="1" height="12" newline="1">
				<Text style="label"><var var="I18N::translate('Last change')" /></Text>
			</TextBox>

			<!-- Pending Changes Section Data -->
			<List list="pending" sortby="$sortby">
				<TextBox height="12" width="$namewidth">
					<Text style="text"><GetPersonName id="" /></Text>
				</TextBox>
				<TextBox height="12" width="$datewidth">
					<Facts ignore="CHAN" families="0" diff="true">
						<Text style="text">
							<var var="@fact" /> <GedcomValue tag="@fact:DATE" /><br />
						</Text>
					</Facts>
				</TextBox>
				<TextBox height="12" newline="1">
					<Text style="text"><GedcomValue tag="CHAN:DATE" /> <GedcomValue tag="CHAN:DATE:TIME" /> - <GedcomValue tag="CHAN:_WT_USER" /></Text>
				</TextBox>

			</List>
			<Cell align="rightrtl" height="25" newline="1" style="label">
				<var var="I18N::translate('Total pending changes: ')" /><ListTotal /><br />
			</Cell>
		</if>

		<!-- Recent Changes Section Header -->
		<Cell align="center" height="20" newline="1" style="header2"><var var="I18N::translate('Recent changes')" /> <var var="changeRangeStart" date="1" /> - <var var="changeRangeEnd" date="1" /></Cell>
		<SetVar name="fill" value="" />
		<if condition="$sortby=='NAME'"><SetVar name="fill" value="#AAAAAA" /></if>
		<TextBox bgcolor="$fill" border="1" height="12" width="$namewidth">
			<Text style="label"><var var="I18N::translate('Name')" /></Text>
		</TextBox>

		<SetVar name="fill" value="" />
		<if condition="$sortby=='BIRT:DATE'"><SetVar name="fill" value="#AAAAAA" /></if>
		<TextBox bgcolor="$fill" border="1" height="12" width="$datewidth">
			<Text style="label"><var var="I18N::translate('Birth')" /> - <var var="I18N::translate('Death')" /></Text>
		</TextBox>

		<SetVar name="fill" value="" />
		<if condition="$sortby=='CHAN'"><SetVar name="fill" value="#AAAAAA" /></if>
		<TextBox bgcolor="$fill" border="1" height="12" newline="1">
			<Text style="label"><var var="I18N::translate('Last change')" /></Text>
		</TextBox>

		<!-- Recent Changes Section Data -->
		<List list="individual" filter1="CHAN:DATE LTE $changeRangeEnd" filter2="CHAN:DATE GTE $changeRangeStart" sortby="$sortby">
			<TextBox height="12" width="$namewidth">
				<Text style="text"><GetPersonName id="" /></Text>
			</TextBox>

			<TextBox height="12" width="$datewidth">
				<Text style="text"><var var="I18N::translate('Birth')" />: <GedcomValue tag="BIRT:DATE" />---<var var="I18N::translate('Death')" />: <GedcomValue tag="DEAT:DATE" /></Text>
			</TextBox>

			<TextBox height="12" newline="1">
				<Text style="text"><GedcomValue tag="CHAN:DATE" /> <GedcomValue tag="CHAN:DATE:TIME" /> - <GedcomValue tag="CHAN:_WT_USER" /></Text>
			</TextBox>
		</List>

		<Cell align="rightrtl" height="25" newline="1" style="label">
			<var var="I18N::translate('Total accepted changes: ')" /><ListTotal />
		</Cell>
	</Body>
	<Footer>
		<Cell align="rightrtl" newline="1" style="date"><Now /></Cell>
	</Footer>`

20220610093539

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream error in a third-party library
Projects
None yet
Development

No branches or pull requests

4 participants