From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 9BB5C4249A for ; Fri, 22 Apr 2022 10:30:57 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 744BF68B3AA; Fri, 22 Apr 2022 13:30:54 +0300 (EEST) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DC35E68AF5C for ; Fri, 22 Apr 2022 13:30:47 +0300 (EEST) Received: from localhost (213-47-68-29.cable.dynamic.surfer.at [213.47.68.29]) (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 2257E2000F for ; Fri, 22 Apr 2022 10:30:46 +0000 (UTC) Date: Fri, 22 Apr 2022 12:30:45 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220422103045.GU2829255@pb2> References: <291427c1-9428-3895-da3e-0de5ca2fba0f@tiscali.it> MIME-Version: 1.0 In-Reply-To: <291427c1-9428-3895-da3e-0de5ca2fba0f@tiscali.it> Subject: Re: [FFmpeg-devel] proposal for a minor change in the behavior of the drawtext filter X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: multipart/mixed; boundary="===============0504151485208744419==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============0504151485208744419== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="RhzLgC6dK600aDju" Content-Disposition: inline --RhzLgC6dK600aDju Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 22, 2022 at 12:01:31PM +0200, Francesco Carusi wrote: > Hello ffmpeg team, >=20 > I'm working on an enhanced version of the drawtext filter and would like = to > discuss with you about a minor change in its behavior related to line > spacing management. > In the current implementation the space between two lines of text is set > equal to the height of the highest glyph found in the text plus the optio= nal > user defined "line_spacing" parameter (which defaults to 0): >=20 > line_height =3D max_glyph_h + line_spacing >=20 > This has some drawbacks: > 1) the line height depends on the text > =A0=A0=A0 See image "line_height-old.png" (the blue lines where added by = me) > =A0=A0=A0 The filter is applied three times with tree slightly different = texts: > the line_spacing parameter was not specified, > =A0=A0=A0 but the actual line height changes due to the different heights= of the > glyphs > 2) the line height is not consistent between the same text being rendered= by > the filter and by external tools >=20 > The proposed change is: > 1) the default line height is set to the font-defined line height > 2) the line_spacing parameter, if specified, sets the actual line height > (line_height =3D line_spacing) > 3) the default value of line_spacing is set to -1 (which means: use the > default line height) >=20 > The image "line_height-new.png" shows the effect of the new behavior. >=20 > Which is the impact of the change? > A) users using the line_spacing parameter would see less space between li= nes > B) users not using the line_spacing parameter would see (in most cases) m= ore > space between lines >=20 > Can the impact be mitigated? > Well, yes, we may add a new parameter named 'line_height' and deprecate > 'line_spacing', in this way anyone using line_spacing explicitly would not > see any change in the filter behavior. I don't like this solution but it = may > help reducing the impact of the change. just looking at the pngs, the old looks bad, the new looks like it has alot more space then reasonable. If i just compare this to any GUI text editor theres not that much space between lines and at the same time the spacing is constant. why can that not be achieved ? thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB When the tyrant has disposed of foreign enemies by conquest or treaty, and there is nothing more to fear from them, then he is always stirring up some war or other, in order that the people may require a leader. -- Plato --RhzLgC6dK600aDju Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYmKD0gAKCRBhHseHBAsP q11VAJ4t2VWrrQKCJISuuFDaFW21DTfhBACglcpgbqCdMH+fZc/9wfoVeh8Z2mo= =BBPf -----END PGP SIGNATURE----- --RhzLgC6dK600aDju-- --===============0504151485208744419== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". --===============0504151485208744419==--