diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2023-02-27 17:17:16 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2023-03-01 06:37:31 +0100 |
commit | 18aa3309a4e4b5a874298af1243095db9aa207d3 (patch) | |
tree | 67135719384c90e0b563f5c5a519b63971722b37 /src/3rdparty/freetype/src/tools/cordic.py | |
parent | a6edf9cbe5bd1d1c6bc08733f97fc07812126bde (diff) |
Update to Freetype 2.13.0
Also adds a file to patches which is a required modification
to the update in order to make it compile.
Pick-to: 5.15 6.2 6.4 6.4.3 6.5
Fixes: QTBUG-111536
Change-Id: Iaabc1b7736cfd98217a8aff2b7f9bc65402d0451
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/3rdparty/freetype/src/tools/cordic.py')
-rw-r--r-- | src/3rdparty/freetype/src/tools/cordic.py | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/src/3rdparty/freetype/src/tools/cordic.py b/src/3rdparty/freetype/src/tools/cordic.py index 6742c90dfe..6511429889 100644 --- a/src/3rdparty/freetype/src/tools/cordic.py +++ b/src/3rdparty/freetype/src/tools/cordic.py @@ -1,33 +1,32 @@ +#!/usr/bin/env python3 + # compute arctangent table for CORDIC computations in fttrigon.c -import sys, math +import math -#units = 64*65536.0 # don't change !! -units = 180 * 2**16 -scale = units/math.pi +# units = 64*65536.0 # don't change !! +units = 180 * 2 ** 16 +scale = units / math.pi shrink = 1.0 -comma = "" +angles2 = [] -print "" -print "table of arctan( 1/2^n ) for PI = " + repr(units/65536.0) + " units" +print("") +print("table of arctan( 1/2^n ) for PI = " + repr(units / 65536.0) + " units") -for n in range(1,32): +for n in range(1, 32): - x = 0.5**n # tangent value + x = 0.5 ** n # tangent value - angle = math.atan(x) # arctangent - angle2 = round(angle*scale) # arctangent in FT_Angle units + angle = math.atan(x) # arctangent + angle2 = round(angle * scale) # arctangent in FT_Angle units if angle2 <= 0: break - sys.stdout.write( comma + repr( int(angle2) ) ) - comma = ", " - - shrink /= math.sqrt( 1 + x*x ) - -print -print "shrink factor = " + repr( shrink ) -print "shrink factor 2 = " + repr( int( shrink * (2**32) ) ) -print "expansion factor = " + repr( 1/shrink ) -print "" + angles2.append(repr(int(angle2))) + shrink /= math.sqrt(1 + x * x) +print(", ".join(angles2)) +print("shrink factor = " + repr(shrink)) +print("shrink factor 2 = " + repr(int(shrink * (2 ** 32)))) +print("expansion factor = " + repr(1 / shrink)) +print("") |