]> granicus.if.org Git - libass/log
libass
9 years agoRemove unused function is_skip_symbol
Rodger Combs [Thu, 29 Jan 2015 18:18:36 +0000 (12:18 -0600)]
Remove unused function is_skip_symbol

9 years agoClean up bitmap combining
Dr.Smile [Fri, 23 Jan 2015 03:32:16 +0000 (06:32 +0300)]
Clean up bitmap combining

Now pre- and post-combining operations are clearly separated,
many parameters in cache keys are no longer necessary due to that.
Also an ambiguous (in case of multiple fonts) text string is replaced
with a list of direct bitmap references in composite cache key.

Fixes #153.
Fixes #82.

9 years agoFix bug in ASS_Outline intrastructure
Dr.Smile [Thu, 22 Jan 2015 20:18:56 +0000 (23:18 +0300)]
Fix bug in ASS_Outline intrastructure

9 years agoAdd extern "C" guard to public header
Oleg Oshmyan [Fri, 16 Jan 2015 11:26:13 +0000 (13:26 +0200)]
Add extern "C" guard to public header

Our public headers can be #included from C++. Hence, ass.h needs
an extern "C" guard to declare the correct linkage for functions.
ass_types.h only defines types, so it does not need a guard.

9 years agoFix rare edge-case bug in rasterizer
Dr.Smile [Thu, 15 Jan 2015 17:53:57 +0000 (20:53 +0300)]
Fix rare edge-case bug in rasterizer

9 years agoUpdate Aegisub links in README
Oleg Oshmyan [Fri, 9 Jan 2015 19:21:57 +0000 (21:21 +0200)]
Update Aegisub links in README

9 years agoUpdate README
Oleg Oshmyan [Thu, 8 Jan 2015 18:45:23 +0000 (20:45 +0200)]
Update README

9 years agoUpdate version and changelog 0.12.1
wm4 [Wed, 7 Jan 2015 16:29:04 +0000 (17:29 +0100)]
Update version and changelog

9 years agoDestroy harfbuzz faces before freetype faces
Behdad Esfahbod [Mon, 29 Dec 2014 00:34:47 +0000 (16:34 -0800)]
Destroy harfbuzz faces before freetype faces

HarfBuzz faces reference the FreeType faces.  Destroying FT faces first can cause crash in HB destruction code:

  https://bugs.freedesktop.org/show_bug.cgi?id=86300

9 years agoReplace FT_Outline with ASS_Outline
Dr.Smile [Sun, 23 Nov 2014 17:01:03 +0000 (20:01 +0300)]
Replace FT_Outline with ASS_Outline

9 years agoFlip coordinate system in rasterizer
Dr.Smile [Mon, 10 Nov 2014 19:36:21 +0000 (22:36 +0300)]
Flip coordinate system in rasterizer

9 years agoFix incorrect closing of last drawing contour
Dr.Smile [Tue, 4 Nov 2014 11:24:28 +0000 (14:24 +0300)]
Fix incorrect closing of last drawing contour

9 years agoLeave spline evaluation to rasterizer
Dr.Smile [Tue, 4 Nov 2014 07:45:08 +0000 (10:45 +0300)]
Leave spline evaluation to rasterizer

9 years agoTravis-CI: Coverity requires a notification email address
wm4 [Sat, 22 Nov 2014 02:23:00 +0000 (03:23 +0100)]
Travis-CI: Coverity requires a notification email address

Or at least it looks like it does.

9 years agoFix broken memory leak check in legacy API
wm4 [Sat, 22 Nov 2014 02:18:25 +0000 (03:18 +0100)]
Fix broken memory leak check in legacy API

This was a check for the realloc() call, but the result was never
used in the success case - which makes no sense.

Doesn't really matter, because it's the legacy charset code which
hopefully is not used by anyone.

Found by Coverity.

9 years agoTravis-CI: make Coverity scan work
wm4 [Sat, 22 Nov 2014 01:55:59 +0000 (02:55 +0100)]
Travis-CI: make Coverity scan work

Also add the obnoxious Coverity badge to the README
(thanks to torque for the reminder).

9 years agoTravis-CI: minor changes
wm4 [Sat, 22 Nov 2014 01:46:06 +0000 (02:46 +0100)]
Travis-CI: minor changes

Strictly use the default compiler, but this probably has exactly the
same effect as using the "gcc" entry.

Do a parallel build.

9 years agoTravis-CI: add coverity_scan branch to enabled branches
wm4 [Sat, 22 Nov 2014 01:16:28 +0000 (02:16 +0100)]
Travis-CI: add coverity_scan branch to enabled branches

9 years agoTravis-CI: add Coverity scan
wm4 [Sat, 22 Nov 2014 01:06:51 +0000 (02:06 +0100)]
Travis-CI: add Coverity scan

9 years agoTravis-CI: another attempt at making it work (2)
wm4 [Sat, 22 Nov 2014 01:03:19 +0000 (02:03 +0100)]
Travis-CI: another attempt at making it work (2)

9 years agoTravis-CI: another attempt at making it work
wm4 [Sat, 22 Nov 2014 00:37:40 +0000 (01:37 +0100)]
Travis-CI: another attempt at making it work

Switching to OSX, because homebrew is more uptodate than
Ubuntu Ancient LTS, which is what Travis uses on Linux.

9 years agoTravis-CI: sigh
wm4 [Sat, 22 Nov 2014 00:30:28 +0000 (01:30 +0100)]
Travis-CI: sigh

OK, so autogen.sh doesn't run configure.

9 years agotravis-CI: configure needs to be generated
wm4 [Sat, 22 Nov 2014 00:28:23 +0000 (01:28 +0100)]
travis-CI: configure needs to be generated

9 years agoAdd Travis-CI integration
wm4 [Sat, 22 Nov 2014 00:24:13 +0000 (01:24 +0100)]
Add Travis-CI integration

9 years agoMore malloc checking
wm4 [Thu, 20 Nov 2014 21:07:02 +0000 (22:07 +0100)]
More malloc checking

Don't crash if running out of memory when allocating per-glyph data
during shaping. Also some fixes to initialization.

The caller of ass_fontconfig.c/match_fullname() actually handles a NULL
return value correctly.

9 years agoMore malloc checking
wm4 [Tue, 18 Nov 2014 18:30:12 +0000 (19:30 +0100)]
More malloc checking

In both cases, fallback to doing nothing if alloc fails.

9 years agoMore malloc checking
wm4 [Mon, 17 Nov 2014 20:24:52 +0000 (21:24 +0100)]
More malloc checking

Use strndup() instead of malloc+copy.

Make all code deal with the possibility that ASS_Drawing.text can be
NULL (which can happen on allocation failure).

Skip fix_collisions() on malloc failure - the lines will overlap, but at
least libass won't crash.

9 years agoProvide a strndup() fallback
wm4 [Mon, 17 Nov 2014 20:22:21 +0000 (21:22 +0100)]
Provide a strndup() fallback

This standard function is not available everywhere, so we detect it and
provide a fallback if missing.

9 years agoFix some of the recently added checks
wm4 [Sun, 16 Nov 2014 23:03:05 +0000 (00:03 +0100)]
Fix some of the recently added checks

9 years agoSome more overflow checks
wm4 [Sun, 16 Nov 2014 20:35:48 +0000 (21:35 +0100)]
Some more overflow checks

9 years agoDeal with code-duplication bullshit
wm4 [Sun, 16 Nov 2014 16:30:02 +0000 (17:30 +0100)]
Deal with code-duplication bullshit

Much of outline_to_bitmap() is duplicated. What?

Add the overflow check to duplicated code too.

9 years agoCheck the overflow check for overflows
wm4 [Sun, 16 Nov 2014 16:23:39 +0000 (17:23 +0100)]
Check the overflow check for overflows

Seriously...

Checking for negative values might not be needed, but do it anyway.

9 years agoCheck bitmap allocation for overflows
wm4 [Sun, 16 Nov 2014 16:23:12 +0000 (17:23 +0100)]
Check bitmap allocation for overflows

This actually fixes #146.

The overflow check itself is obvious. Also, make ass_align() return an
unaligned value if aligning it would overflow. This is probably better,
as it for example makes the overflow check in the caller simpler.

9 years agoPrint debug message when loading a memory font
wm4 [Sat, 15 Nov 2014 19:24:04 +0000 (20:24 +0100)]
Print debug message when loading a memory font

9 years agoSplit some parts of ass_render_event into functions
wm4 [Sat, 15 Nov 2014 19:21:37 +0000 (20:21 +0100)]
Split some parts of ass_render_event into functions

The split doesn't necessarily follow any logic; for the most part
it just moves each processing loop into its own function.

9 years agoCheck some allocations in strike-through code
wm4 [Fri, 14 Nov 2014 19:19:34 +0000 (20:19 +0100)]
Check some allocations in strike-through code

9 years agoAdd another helper-macro for array allocation
wm4 [Fri, 14 Nov 2014 19:19:14 +0000 (20:19 +0100)]
Add another helper-macro for array allocation

9 years agoFix recently introduced overflow check (again)
wm4 [Fri, 14 Nov 2014 18:03:04 +0000 (19:03 +0100)]
Fix recently introduced overflow check (again)

9 years agoFix the bug
wm4 [Fri, 14 Nov 2014 00:45:09 +0000 (01:45 +0100)]
Fix the bug

Commit 8536eaa was slightly broken: for some incomprehensible reason,
(w + 1) memory instead of w is needed. The missing space could lead to
memory corruption and crashes.

9 years agoSimplify ass_utils.c code
Youka [Sun, 9 Nov 2014 19:11:57 +0000 (20:11 +0100)]
Simplify ass_utils.c code

Mainly cosmetic, but maybe some optimizations the compiler misses.

9 years agoClean up and improve .gitignore
Youka [Fri, 7 Nov 2014 16:03:22 +0000 (17:03 +0100)]
Clean up and improve .gitignore

Add * suffix to executable names for the sake of Windows,
where they get .exe extension automatically appended.

9 years agoUse stdbool.h in another place
wm4 [Thu, 13 Nov 2014 20:27:23 +0000 (21:27 +0100)]
Use stdbool.h in another place

Also fix that ass_synth_init() could deref NULL.

9 years agoCheck for another overflow in blur code
wm4 [Thu, 13 Nov 2014 20:06:10 +0000 (21:06 +0100)]
Check for another overflow in blur code

9 years agoMove apply_blur() to ass_bitmap.c
wm4 [Thu, 13 Nov 2014 19:51:51 +0000 (20:51 +0100)]
Move apply_blur() to ass_bitmap.c

Put all code into one place, which makes it easier to follow.

9 years agoCheck against some overflows and allocation failures on blur
wm4 [Tue, 11 Nov 2014 10:45:37 +0000 (11:45 +0100)]
Check against some overflows and allocation failures on blur

This still doesn't catch all cases.

9 years agoAdd ass_realloc_array()
wm4 [Tue, 11 Nov 2014 10:44:54 +0000 (11:44 +0100)]
Add ass_realloc_array()

Helps with overflow and allocation failure checking.

9 years agoCheck more mallocs
wm4 [Sun, 9 Nov 2014 09:41:54 +0000 (10:41 +0100)]
Check more mallocs

This is just a start and gets most easy ones.

9 years agoProvide SIZE_MAX fallback
wm4 [Sun, 9 Nov 2014 09:40:59 +0000 (10:40 +0100)]
Provide SIZE_MAX fallback

SIZE_MAX is in C99, but not in C89. It is in <stdint.h>, and is always a
macro, so this fallback should be pretty portable and cause no issues.

9 years agoCheck more allocations
Rodger Combs [Fri, 7 Nov 2014 18:49:18 +0000 (14:49 -0400)]
Check more allocations

Part of #146

9 years agoFix UB at left shifts of negative integers
Dr.Smile [Fri, 7 Nov 2014 14:14:40 +0000 (17:14 +0300)]
Fix UB at left shifts of negative integers

9 years agoFix subpixel shadow shift
Dr.Smile [Wed, 5 Nov 2014 23:57:03 +0000 (02:57 +0300)]
Fix subpixel shadow shift

9 years agoOnly use the subpixel value when shifting bitmaps. Fixes #142
Rodger Combs [Wed, 5 Nov 2014 18:52:07 +0000 (14:52 -0400)]
Only use the subpixel value when shifting bitmaps. Fixes #142

9 years agoLoad embedded fonts from memory correctly
wm4 [Tue, 4 Nov 2014 20:08:58 +0000 (21:08 +0100)]
Load embedded fonts from memory correctly

9 years agoUse LT_INIT for better autoreconf compatibility
Rodger Combs [Sun, 26 Oct 2014 00:47:23 +0000 (19:47 -0500)]
Use LT_INIT for better autoreconf compatibility

9 years agoUpdate version and changelog 0.12.0
Grigori Goronzy [Wed, 22 Oct 2014 22:37:33 +0000 (00:37 +0200)]
Update version and changelog

9 years agoProvide slightly more fine-grained control over style overrides
wm4 [Thu, 16 Oct 2014 23:55:16 +0000 (01:55 +0200)]
Provide slightly more fine-grained control over style overrides

9 years agoSilence compilation warning
wm4 [Thu, 16 Oct 2014 23:26:30 +0000 (01:26 +0200)]
Silence compilation warning

This fixes the following warnings:

In file included from ass_cache.c:34:0:
ass_cache_template.h:52:0: warning: "BINSTRING" redefined
 #define BINSTRING(member) \
 ^
In file included from ass_cache.h:59:0,
                 from ass_font.h:58,
                 from ass_cache.c:28:
ass_cache_template.h:9:0: note: this is the location of the previous definition
 #define BINSTRING(member) \
 ^
In file included from ass_cache.c:36:0:
ass_cache_template.h:30:0: warning: "BINSTRING" redefined
 #define BINSTRING(member) \
 ^
In file included from ass_cache.c:34:0:
ass_cache_template.h:52:0: note: this is the location of the previous definition
 #define BINSTRING(member) \
 ^

10 years agoFix caching of combined bitmaps after complex shaping
Oleg Oshmyan [Thu, 4 Sep 2014 20:02:21 +0000 (22:02 +0200)]
Fix caching of combined bitmaps after complex shaping

10 years agoCheck FT_Outline_New return value
wm4 [Sun, 31 Aug 2014 18:22:24 +0000 (20:22 +0200)]
Check FT_Outline_New return value

Makes #131 not crash. The function likely fails because the number of
points exceeds SHRT_MAX.

10 years agoCorrectly close last contour in case of overflow
Dr.Smile [Mon, 25 Aug 2014 23:05:42 +0000 (03:05 +0400)]
Correctly close last contour in case of overflow

10 years agoCheck for 0-point contours in rasterizer_set_outline()
Dr.Smile [Mon, 25 Aug 2014 23:02:15 +0000 (03:02 +0400)]
Check for 0-point contours in rasterizer_set_outline()

Fixes libass#129.

10 years agoFix \fade(7-argument version) parse
Maks Naumov [Fri, 22 Aug 2014 22:54:23 +0000 (01:54 +0300)]
Fix \fade(7-argument version) parse

10 years agoMerge pull request #119 from MrSmile/fix-drawing-overflow
Rodger Combs [Sat, 19 Jul 2014 05:17:41 +0000 (00:17 -0500)]
Merge pull request #119 from MrSmile/fix-drawing-overflow

Fix integer overflow in FT_Outline

10 years agoMerge pull request #116 from hadvaid/dragonfly
Rodger Combs [Sat, 19 Jul 2014 05:17:17 +0000 (00:17 -0500)]
Merge pull request #116 from hadvaid/dragonfly

configure.ac: Treat DragonFly as the rest of BSDs

10 years agoFix integer overflow in FT_Outline
Dr.Smile [Fri, 18 Jul 2014 15:25:57 +0000 (19:25 +0400)]
Fix integer overflow in FT_Outline

10 years agoconfigure.ac: Treat DragonFly as the rest of BSDs
Jan Beich [Tue, 15 Jul 2014 12:21:33 +0000 (12:21 +0000)]
configure.ac: Treat DragonFly as the rest of BSDs

10 years agoass_parse: remove 2 unused variables
wm4 [Sun, 8 Jun 2014 23:56:22 +0000 (01:56 +0200)]
ass_parse: remove 2 unused variables

Fallout from the previous commits.

10 years agoSimplify drawing text assignment
Oleg Oshmyan [Thu, 29 May 2014 23:15:03 +0000 (00:15 +0100)]
Simplify drawing text assignment

10 years agoUse ass_drawing_add_chars for vector drawings
Oleg Oshmyan [Thu, 29 May 2014 23:01:41 +0000 (00:01 +0100)]
Use ass_drawing_add_chars for vector drawings

This not only provides a performance improvement but also
conveniently fixes the following issue: we used to interpret
backslash-escapes in vector drawings, but we shouldn't.

10 years agoparse_tag: remove unnecessary malloc
Oleg Oshmyan [Thu, 29 May 2014 22:38:45 +0000 (23:38 +0100)]
parse_tag: remove unnecessary malloc

10 years agoRequire closing '}' for override tags
Oleg Oshmyan [Thu, 29 May 2014 22:10:30 +0000 (23:10 +0100)]
Require closing '}' for override tags

Like VSFilter. '{' without a following '}' is just text, though
in vector drawing mode it still delimits individual drawings.

This also lets us nicely avoid '\0' hacks
in the \t override tag handler in parse_tag.

10 years agoIntroduce ass_drawing_add_chars for adding a whole string at once
Oleg Oshmyan [Sat, 17 May 2014 23:31:14 +0000 (00:31 +0100)]
Introduce ass_drawing_add_chars for adding a whole string at once

10 years agoParse override tag arguments exactly like VSFilter 2.38
Oleg Oshmyan [Sat, 17 May 2014 21:47:45 +0000 (22:47 +0100)]
Parse override tag arguments exactly like VSFilter 2.38

Also replace strtocolor in ass_utils with string2color
from ass.c, because that is more useful everywhere now.

10 years agoMove (r)skip_spaces to ass_utils
Oleg Oshmyan [Sat, 17 May 2014 21:39:33 +0000 (22:39 +0100)]
Move (r)skip_spaces to ass_utils

10 years agoparse_tag: merge \fs+, \fs-, \fs
Oleg Oshmyan [Thu, 1 May 2014 01:47:43 +0000 (02:47 +0100)]
parse_tag: merge \fs+, \fs-, \fs

10 years agoparse_tag: split \fscx, \fscy, \fsc
Oleg Oshmyan [Thu, 1 May 2014 01:47:43 +0000 (02:47 +0100)]
parse_tag: split \fscx, \fscy, \fsc

10 years agoAdd a mechanism for selective style overrides
wm4 [Wed, 4 Jun 2014 22:55:13 +0000 (00:55 +0200)]
Add a mechanism for selective style overrides

This adds 2 new API functions:

  ass_set_selective_style_override()
  ass_set_selective_style_override_enabled()

They can be used to force dialog text to use a specific ASS_Style. It
uses a fuzzy heuristic for that, and the quality of results may vary.
It does style overriding selectively and tries not to override things
that need explicit styling. The heuristic for that isn't set in stone
either, and can change with future libass versions.

Closes libass#88.

10 years agoMerge pull request #100 from astiob/stroke
Grigori Goronzy [Sun, 1 Jun 2014 22:16:28 +0000 (00:16 +0200)]
Merge pull request #100 from astiob/stroke

Use FT_Outline_EmboldenXY

10 years agoAdd BorderStyle=4, background color for text
wm4 [Sat, 31 May 2014 21:56:24 +0000 (23:56 +0200)]
Add BorderStyle=4, background color for text

This is somewhat similar to BorderStyle=3, but with a number of
differences. Mainly, this new BorderStyle doesn't create overlaps
within an event.

Closes #105.

10 years agoFix change detection when text is clipped to screen
wm4 [Sat, 31 May 2014 21:19:45 +0000 (23:19 +0200)]
Fix change detection when text is clipped to screen

The glyphs are clipped before combining, so the combined bitmap can
always have the same position, size, and address. This breaks the
change detection. Or at least I think that's what happens.

10 years agoRemove bitmap restriding
wm4 [Sun, 1 Jun 2014 02:35:24 +0000 (04:35 +0200)]
Remove bitmap restriding

It turns out we don't need this.

10 years agoUse FT_Outline_EmboldenXY if available
Oleg Oshmyan [Sun, 18 May 2014 02:50:12 +0000 (03:50 +0100)]
Use FT_Outline_EmboldenXY if available

10 years agoMerge pull request #102 from grigorig/fribidi-errorhandle
Grigori Goronzy [Thu, 29 May 2014 23:12:49 +0000 (01:12 +0200)]
Merge pull request #102 from grigorig/fribidi-errorhandle

shaper: add FriBidi error handling

10 years agoshaper: add FriBidi error handling
Grigori Goronzy [Thu, 29 May 2014 01:59:08 +0000 (03:59 +0200)]
shaper: add FriBidi error handling

It is unlikely, but FriBidi might not process a string correctly,
and we should handle that. Tested by making it fail always. This
should also fix some compiler warnings.

10 years agoSkip useless memset() when copying a bitmap
Rodger Combs [Sun, 25 May 2014 17:47:18 +0000 (12:47 -0500)]
Skip useless memset() when copying a bitmap

10 years agoFix \1a, \2a, \3a, \4a with invalid argument
Oleg Oshmyan [Fri, 2 May 2014 21:47:50 +0000 (22:47 +0100)]
Fix \1a, \2a, \3a, \4a with invalid argument

Reset to the initial color's alpha component, not red.

10 years agoReset clipping mode on every rectangle \clip
Oleg Oshmyan [Thu, 1 May 2014 01:38:33 +0000 (02:38 +0100)]
Reset clipping mode on every rectangle \clip

Prior to this fix, both of the following:
    \iclip(0,0,9999,9999)\clip(0,0,9999,9999)
    \iclip(0,0,0,0)\clip(0,0,9999,9999)
hid the whole picture in libass. The correct behavior
in both cases is to display the whole picture.

10 years agoMake \be animatable
Oleg Oshmyan [Wed, 30 Apr 2014 23:32:50 +0000 (00:32 +0100)]
Make \be animatable

VSFilter has supported this since version 2.39.

Use the raw floating-point value of the \be argument in the animation
formula, like xy-VSFilter has done since version 3.0.0.45 (404301a3).

10 years agomystrtoll: don't truncate to int
Oleg Oshmyan [Wed, 30 Apr 2014 23:17:23 +0000 (00:17 +0100)]
mystrtoll: don't truncate to int

10 years agoFix corner case: \move with identical start and end times
Oleg Oshmyan [Wed, 30 Apr 2014 23:06:28 +0000 (00:06 +0100)]
Fix corner case: \move with identical start and end times

10 years agoImplement fast quad-tree rasterizer in C and x86/SSE2/AVX2
Dr.Smile [Fri, 28 Mar 2014 18:17:46 +0000 (22:17 +0400)]
Implement fast quad-tree rasterizer in C and x86/SSE2/AVX2

Signed-off-by: Rodger Combs <rodger.combs@gmail.com>
10 years agoFix premature parser exit on }{ in drawing mode
Oleg Oshmyan [Sun, 27 Apr 2014 21:26:16 +0000 (22:26 +0100)]
Fix premature parser exit on }{ in drawing mode

Fixes #75.

10 years agoFixed headers in profile and test
Rodger Combs [Sun, 27 Apr 2014 04:07:09 +0000 (23:07 -0500)]
Fixed headers in profile and test

10 years agoUpdate README
Grigori Goronzy [Fri, 25 Apr 2014 17:38:52 +0000 (19:38 +0200)]
Update README

10 years agoUpdate version info and changelog 0.11.2
Grigori Goronzy [Fri, 25 Apr 2014 17:28:17 +0000 (19:28 +0200)]
Update version info and changelog

10 years agoInitialize \pbo for each event
Oleg Oshmyan [Thu, 10 Apr 2014 15:41:57 +0000 (18:41 +0300)]
Initialize \pbo for each event

Regression in commit 1f5eb5eb.
Fixes issue #74.

10 years agoDon't crash on \fscx0 with non-zero \blur
Oleg Oshmyan [Thu, 27 Mar 2014 22:19:56 +0000 (00:19 +0200)]
Don't crash on \fscx0 with non-zero \blur

Regression in commit 98707694.

10 years agoshaper: fix nasty sign bug in font functions
Grigori Goronzy [Mon, 17 Mar 2014 00:40:49 +0000 (01:40 +0100)]
shaper: fix nasty sign bug in font functions

Fixes issue #68.

10 years agoMerge pull request #66 from grigorig/drawing-floats
Grigori Goronzy [Sun, 16 Mar 2014 13:55:49 +0000 (14:55 +0100)]
Merge pull request #66 from grigorig/drawing-floats

drawing: parse numbers as floats

10 years agodrawing: parse numbers as floats
Grigori Goronzy [Sat, 15 Mar 2014 11:11:50 +0000 (12:11 +0100)]
drawing: parse numbers as floats

Parse values as float and convert into 26.6 fixed point. This actually
simplifies scaling a bit.

Fixes #63.