From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/115338 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thangalin via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: SVG text alignment issue Date: Tue, 28 Jun 2022 21:55:26 -0700 Message-ID: References: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8431962519713767394==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3751"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Thangalin , Thangalin via ntg-context To: Aditya Mahajan Original-X-From: ntg-context-bounces@ntg.nl Wed Jun 29 06:56:29 2022 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o6Pka-0000fx-8l for gctc-ntg-context-518@m.gmane-mx.org; Wed, 29 Jun 2022 06:56:28 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 436112A3921; Wed, 29 Jun 2022 06:55:46 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 40Vm3t8H8TP8; Wed, 29 Jun 2022 06:55:43 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id BB5DD2A3AE4; Wed, 29 Jun 2022 06:55:43 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 59F452A3A5F for ; Wed, 29 Jun 2022 06:55:42 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QARquWmqa49s for ; Wed, 29 Jun 2022 06:55:40 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.215.176; helo=mail-pg1-f176.google.com; envelope-from=thangalin@gmail.com; receiver= Original-Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id F0D842A3921 for ; Wed, 29 Jun 2022 06:55:39 +0200 (CEST) Original-Received: by mail-pg1-f176.google.com with SMTP id 9so14196537pgd.7 for ; Tue, 28 Jun 2022 21:55:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PK+OD4rdbInSdiX5X/npi/DJNOkaSO3icDrHGNYmDdc=; b=ikiiFHky5iV2LdueUS6jxuXqGjGtwSZOf6ChquOAR8JNwnZ9mSj+Om88RPVzEKUHmj n7FzelKWJrNdfMzPBlzioMtndOQvhbb/XgFTSf4tKplZTo8Y16GgS/XtETU6l246gSwG 26xfwUBeNWe77zezBMSdy6LhCRcyGVd3JAVozammvYNOAW8cVUK6rDjIX3LSMHNDxpVW ZLFjBxcfEPRg3kmePC6hys4uHSwPNPlOWjlXIkwy/i4p8wmCs+mMspgXoneVOsa4dC7F k65kceQNtgEp+8utgbdnILKLt08jBjOtnTNJADV374Bk5k8+bA8kHiPqx6pU0QQxZgTs t8Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PK+OD4rdbInSdiX5X/npi/DJNOkaSO3icDrHGNYmDdc=; b=YsSMDfpeDciQSlNrayxINhTAiEw7iYn2gsIfzhlumVB/UDXyMpGlqg/5c8niwpbtHy Ul0F1CNL3iQIZ/QBiffK5UlrKwLGmQJJKQnNRg4Z8nZZdgjQPWEVQhiDKDR+EoAicB9U PPKwOLrrAXD6QUYUDPm6muEZ3kjtJN/s4VFuxGAvYgis3H2kpMdmVlxVzwUSX/nyzkov VeX2vqx7BAXtvlfm1jj/sILQMrb1UCC7fh4VbxqlMNqwVcm3BjwVRdbpMDCFqcN1dyLm bRQR9xL7XB52/g3dXiK/M1rI5D5fnP8+RMwq98w54dmwrB8D8/I36kLge+EaqsyH7qaz uPVQ== X-Gm-Message-State: AJIora/TxaKH5igZrBobPJS7BZKb43xAFc4ITQHxom0fcA1weDXdo8bW IjVyPK4Amlw4ThHhy7NT6Nn+drf05Ms32a2BVzw= X-Google-Smtp-Source: AGRyM1tHbfLt2w/p2nQLRWc4IJ5/sDVzzvcNj1SdRDezm75Nuj2iifQ+DXKLYRYHkAJCCrnFGPR7eoCeT0UJqFN9PfM= X-Received: by 2002:a63:1a09:0:b0:3fd:ac2b:3876 with SMTP id a9-20020a631a09000000b003fdac2b3876mr1375881pga.457.1656478537936; Tue, 28 Jun 2022 21:55:37 -0700 (PDT) In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:115338 Archived-At: --===============8431962519713767394== Content-Type: multipart/alternative; boundary="000000000000d4f5e705e28ef6bc" --000000000000d4f5e705e28ef6bc Content-Type: text/plain; charset="UTF-8" Thanks Aditya, I tried your suggestion, but the result is the same. Here's the XML setup for all images in the document: \startxmlsetups xml:img \starttexcode \placefloat[here,force]{}{% \hbox{\externalfigure[\xmlatt{#1}{src}][conversion=mp]} } \stoptexcode \stopxmlsetups Here's the Markdown source document: ![](dna-02) The source document is automatically exported as XHTML:

The XHTML is then passed to ConTeXt, whereupon the XML setup for images is applied. The result is the same: the alignment for the text is off. Here's an example where you can see the issue on the 16q24.3 text (far right): https://i.ibb.co/WGh03Sr/genes.png When the same SVG file is rendered using Apache Batik, the white text is aligned to the middle of the black box. Are there aAny other work-arounds? Thank you! --000000000000d4f5e705e28ef6bc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Tha= nks Aditya,
I tried your = suggestion, but the result is the same. Here's the XML setup for all im= ages in the document:

\startxmlsetups xml:img
=C2=A0 \starttexcode
=C2=A0 =C2=A0 \placeflo= at[here,force]{}{%
=C2=A0 =C2=A0 =C2=A0 \hbox{\externalfigure[\xmlatt{#1= }{src}][conversion=3Dmp]}
=C2=A0 =C2=A0 }
=C2=A0 \stoptexcode
\sto= pxmlsetups

=
Here's the= Markdown source document:

![](dna-02)
<= br>
The source = document is automatically exported as XHTML:

<p>
=C2=A0 =C2=A0 =C2=A0 <img alt=3D&qu= ot;" src=3D"/path/to/images/dna-02.svg"/>
=C2=A0 =C2= =A0 </p>
=
The XHTML = is then passed to ConTeXt, whereupon the XML setup for images is applied. T= he result is the same: the alignment for the text is off. Here's an exa= mple where you can see the issue on the 16q24.3 text (far right):
=


When the same SVG file is rendered using Apa= che Batik, the white text is aligned to the middle of the black box.

Ar= e there aAny other work-arounds?

Thank you!

--000000000000d4f5e705e28ef6bc-- --===============8431962519713767394== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============8431962519713767394==--