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

Position generated outlines relative to dominant letters #227

Merged

Conversation

frederickobrien
Copy link
Member

@frederickobrien frederickobrien commented Feb 5, 2024

This addresses issue #223 by adding a new createStartingObject() function that's used when generating outline objects. It finds a word's dominant letter and calculates the overall starting point accordingly.

Before

image

After

image

Yuuuge step forward, this. Generated outlines are going to be so much better. Also opens the door to abstracting a bunch more special outlines (#222).

Potential followup: adjusting the starting point to ensure the outline is always centered.

Copy link

netlify bot commented Feb 5, 2024

Deploy Preview for teeline-online ready!

Name Link
🔨 Latest commit cfa3b14
🔍 Latest deploy log https://app.netlify.com/sites/teeline-online/deploys/65c13044335bd000086f5725
😎 Deploy Preview https://deploy-preview-227--teeline-online.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@frederickobrien frederickobrien marked this pull request as ready for review February 5, 2024 19:07
@frederickobrien frederickobrien merged commit 1a51d4a into main Feb 5, 2024
4 checks passed
Copy link
Collaborator

@mxdvl mxdvl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat!


export const passiveConsonants = ['c', 'f', 'k', 'm', 'n', 'q', 'r', 's', 'v', 'w', 'x', 'y', 'z'];

export const alphabet = [...vowels, ...dominantConsonants, ...passiveConsonants];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to add a little test that this arrays create a Set of size 26

export const createStartingObject = (text: string, lettersObjectArray: OutlineObject[]) => {
// Identify dominant letter
const findDominantLetter = (word: string | undefined) => {
const dominantConsonant = word.split('').find((letter) => dominantConsonants.includes(letter));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if word is undefined?

Suggested change
const dominantConsonant = word.split('').find((letter) => dominantConsonants.includes(letter));
const dominantConsonant = word?.split('').find((letter) => dominantConsonants.includes(letter));

@frederickobrien frederickobrien deleted the position-outlines-relative-to-dominant-letters branch February 6, 2024 11:12
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.

Position generated outlines relative to their first dominant letter
2 participants