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

font-edit: Improve the type descriptions #29

Merged
merged 2 commits into from
Aug 7, 2024
Merged

font-edit: Improve the type descriptions #29

merged 2 commits into from
Aug 7, 2024

Conversation

jouae
Copy link
Collaborator

@jouae jouae commented Aug 5, 2024

Currently, the font-edit tool relies on Xlib. According to #7, font-edit should be restructured using SDL2 to enhance portability.

Before proceeding with this work, it is necessary to understand the significance and operational principles of TWIN’s existing functionality. Therefore, we first need to add clear comments to the typedefs and functions in twin-fedit.h to provide a basis for future modifications and porting to SDL2.

To avoid disrupting other developers who might be using the tool during this process, a new branch named font-edit is created.

Currently, there is a lack of description for geometric types and functions.

pt_t is used to describe a geometric object—a point, while pts_t is used to
describe a dynamically configurable array.
n is used to describe the current number of configured points,
and s is used to describe the maximum configurable memory limit, measured in bytes.

spline_t is used to describe cubic spline interpolation based on four points.

new_pts, dispose_pts, and add_pt are methods for the pt_t and pts_t types.

distance_to_point, distance_to_line, and distance_to_segment
are used to describe the distance relationships between geometric objects.

lerp is a function for computing linear interpolation points.

fit is used to compute a spline with a specific error tolerance.
tools/font-edit/twin-fedit.h Outdated Show resolved Hide resolved
tools/font-edit/twin-fedit.h Outdated Show resolved Hide resolved
@jserv jserv changed the title Improvements and Description for font-edit font-edit: Improve the type descriptions Aug 6, 2024
There are both camelCase and underscore naming styles

To maintain consistency, the following variable names are changed:

OpMove -> op_move
OpLine -> op_line
OpCurve -> op_curve
OpNoop -> op_noop

Additionally, to maintain consistency in the identify of struct,
avoid conflicts with alias, the following change is made:

_pts_t -> _pts

Refs:
	1. ISO/IEC 9899:1999
		6.7.2.3 Tags
		6.7.7 Type definitions
@jserv jserv merged commit a1ba2eb into sysprog21:main Aug 7, 2024
3 checks passed
@jserv
Copy link
Contributor

jserv commented Aug 7, 2024

Thank @jouae for contributing!

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.

2 participants