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

Introduce parameters to OptimalFit #389

Merged
merged 1 commit into from
Jun 22, 2021
Merged

Introduce parameters to OptimalFit #389

merged 1 commit into from
Jun 22, 2021

Conversation

mgeisler
Copy link
Owner

This turns the hard-coded penalty constants used by wrap_optimal_fit into adjustable parameters. This makes it feasible to wrap proportional text using the optimal-fit algorithm.

Fixes #326.

@mgeisler mgeisler force-pushed the optimal-fit-params branch 5 times, most recently from f84add9 to b5f734c Compare June 22, 2021 20:49
The hard-coded penalties only really worked for monospaced text since
they made assumptions about what a gap of “5 columns” mean. Those
assumptions quickly broke down when we’re talking about wrapping
proportional text, as shown in the Wasm demo.

This PR changes the `OptimalFit` struct so it now carries the values
needed by `wrap_optimal_fit`. The Wasm demo has been adapted to show
this in action – the interface is now quite crowded, and we’ll have to
clean this up next.

Fixes #326.
@mgeisler mgeisler force-pushed the optimal-fit-params branch from b5f734c to 01f51cd Compare June 22, 2021 21:10
@mgeisler mgeisler enabled auto-merge June 22, 2021 21:11
@mgeisler mgeisler merged commit 607704a into master Jun 22, 2021
@mgeisler mgeisler deleted the optimal-fit-params branch June 22, 2021 21:13
@github-actions github-actions bot mentioned this pull request Jun 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make optimal-fit penalties adjustable
2 participants