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

feat: enable usage in browser by providing font array buffer #22

Merged
merged 4 commits into from
Mar 9, 2021

Conversation

LabhanshAgrawal
Copy link
Contributor

Added a function to create the Font object from ArrayBuffer of the font
Adding this to make it possible to use this library in the browser with font data from font access API, see this comment in xtermjs/xterm.js#958

@LabhanshAgrawal
Copy link
Contributor Author

@Tyriar @princjef I'm guessing this should be enough to use this module in browser if we directly call loadBuffer. Should I move the imports for util and font-finder inside the load functions where they are used, using require?

@codecov
Copy link

codecov bot commented Feb 20, 2021

Codecov Report

❗ No coverage uploaded for pull request base (master@c0b1f32). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##             master   #22   +/-   ##
======================================
  Coverage          ?     0           
======================================
  Files             ?     0           
  Lines             ?     0           
  Branches          ?     0           
======================================
  Hits              ?     0           
  Misses            ?     0           
  Partials          ?     0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c0b1f32...5bb3a10. Read the comment docs.

@LabhanshAgrawal LabhanshAgrawal changed the title feat: add option to load font from array buffer feat: enable usage in browser by providing font array buffer Feb 20, 2021
@LabhanshAgrawal
Copy link
Contributor Author

@princjef can you please take a look at this and tell if it's ok. This will enable xterm ligatures addon to be used inside browsers compared to being electron only at the moment.

@princjef
Copy link
Owner

princjef commented Mar 8, 2021

Hey @LabhanshAgrawal sorry for the delay. The code looks good. Could you add an entry to the API documentation in the README noting the new loadBuffer function?

@LabhanshAgrawal
Copy link
Contributor Author

Hey @LabhanshAgrawal sorry for the delay. The code looks good. Could you add an entry to the API documentation in the README noting the new loadBuffer function?

Done

@princjef princjef merged commit b8abbcd into princjef:master Mar 9, 2021
@LabhanshAgrawal LabhanshAgrawal deleted the buffer branch March 9, 2021 17:24
princjef added a commit that referenced this pull request Mar 9, 2021
# [1.4.0](v1.3.3...v1.4.0) (2021-03-09)

### Features

* enable usage in browser by providing font array buffer ([#22](#22)) ([b8abbcd](b8abbcd))
@princjef
Copy link
Owner

princjef commented Mar 9, 2021

🎉 This PR is included in version 1.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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