Commit Graph

73 Commits

Author SHA1 Message Date
fiatjaf
b9ad4b518f update go-nostr, eventstore, khatru; replace nostr-sdk. 2024-09-16 15:55:36 -03:00
dtonon
a731bd27f5 Add text preview for Facebook / Instagram 2024-09-12 12:35:53 +02:00
fiatjaf
0dd8c38a95 remove opentelemetry. 2024-08-02 15:41:29 -03:00
fiatjaf
c0004f67a2 fix slowness of previous refactors that injected nostr-sdk into this codebase + refactors.
- adjusting many small things related to nostr-sdk usage
- fetching profiles in a smarter way
- decoupling the logic for rendering profile pages from the `grabData`/`getEvent` flow of other event pages.
- incorporating nostr-sdk more holistically, including more hints stuff
- improving nostr-sdk itself after some bugs and weird behaviors observed here
- set up opentelemetry (should probably remove this later)
2024-08-02 12:48:58 -03:00
fiatjaf
dd456ca446 nothing. 2024-07-28 18:15:17 -03:00
fiatjaf
47423ddcc4 move some things to enhanced_event.go, that makes more sense. 2024-06-19 22:06:09 -03:00
fiatjaf
c08f907feb recover from panic when drawing images and just error. 2024-06-13 15:04:57 -03:00
fiatjaf
b19f066a9d remove those many annoying fmt.Println() calls on every handler. 2024-06-12 15:42:56 -03:00
Yasuhiro Matsumoto
7b05b0e80c fix typo 2024-02-18 09:56:19 -03:00
fiatjaf
0d72c70d00 fix bound checks for paragraphs array. 2024-01-30 08:53:52 -03:00
fiatjaf
a9c84f86d7 cleaner failures when media fails to load or draw. 2024-01-12 11:00:52 -03:00
fiatjaf
d7bab9b31a fix for index out of range when checking if next paragraph is media. 2024-01-12 10:08:13 -03:00
Daniele Tonon
7ae564679a Remove extra top padding from the preview if the first block is an image 2024-01-11 18:36:32 +01:00
fiatjaf
a7325ea795 multiple fixes and adjustments until it compiles and runs. 2024-01-08 08:44:01 -03:00
Daniele Tonon
b44771b0da Render videos inside the image preview 2024-01-06 01:13:19 +01:00
Daniele Tonon
5e46f10453 Render images inside the image preview 2024-01-06 00:36:53 +01:00
Daniele Tonon
b52c514653 Merge branch 'dynamic-font-size-stuff' 2024-01-05 12:52:22 +01:00
fiatjaf
eb8c9c393d get rid of twitter messy inscriptions over our image. 2024-01-05 01:11:42 -03:00
Daniele Tonon
33d02097a1 Optimize text rendering, avoiding useless prints 2024-01-03 08:13:06 +01:00
Daniele Tonon
3e7f755f69 Update cut gradient calculation, again 2024-01-03 08:05:42 +01:00
Daniele Tonon
7728387171 Update font-size calculation, again 2024-01-03 08:04:49 +01:00
Daniele Tonon
e8d5141088 Update logic to show the cut gradient
S
2024-01-02 18:31:06 +01:00
Daniele Tonon
497bf5e39c Update font-size calculation including height of text-image 2024-01-02 18:23:13 +01:00
Daniele Tonon
ab4c2670f6 Support fake extension in text-image to permit easy loading on Nostr 2024-01-02 16:54:48 +01:00
Daniele Tonon
1612251487 Update text highlighting colors 2024-01-02 14:06:58 +01:00
fiatjaf
5882462547 hlSkip and stop using @ prefix on names. 2024-01-02 10:06:44 -03:00
fiatjaf
587b096ebc cleanup the formula code. 2023-12-31 18:18:10 -03:00
fiatjaf
1cbc1436c9 remove a print statement. 2023-12-31 18:15:55 -03:00
fiatjaf
51a5bd770a replace fancy dynamic font size detector with a mathematical formula that should be good enough.
the fancy thing was breaking for all japanese and chinese notes, and in some english notes too, I don't know why.

it also gave me a bad feeling because it was a loop that seemed expensive.
2023-12-31 17:50:44 -03:00
fiatjaf
d85872a1b5 naïve text highlighting. 2023-12-31 14:26:14 -03:00
Daniele Tonon
37a05bf2a4 Improve dynamic font size calculation in text-image 2023-12-29 14:51:22 +01:00
Daniele Tonon
83cb6f4cc1 Add dynamic font resizing for <140 chars notes 2023-12-28 23:16:03 +01:00
Daniele Tonon
f748b99eb1 Show cut gradient at the text-image bottom only if necessary 2023-12-28 23:00:22 +01:00
Daniele Tonon
89ed30c1ec Fix different Telegram padding in the text-image 2023-12-28 21:40:10 +01:00
Daniele Tonon
6c85d22962 Render author name using drawText() to support emoji 2023-12-28 21:22:49 +01:00
fiatjaf
f06badf393 trying to remove unused glyphs from mainBuffer since they got merged in emojiBuffer. 2023-12-28 15:39:44 -03:00
fiatjaf
bfb1477ce6 fix newline replacer code and remove \t and \r before rendering. 2023-12-28 09:03:14 -03:00
fiatjaf
e17b3e2b45 fix emojiMask not working correctly.
its index was being reset for each wrapped line thus not corresponding to the actual position in the full paragraph content anymore.

basically if the emojiMask was [false, false, false, true, false] for "abc🔛d" but that text was split in two lines like:
"abc
🔛d"
then the emojiMask would be read at 0, 1, 2, then 0, 1.

now that is fixed.
2023-12-28 06:48:14 -03:00
fiatjaf
9f30fbeac9 document the mess we made with the font rendering stuff. 2023-12-26 22:16:31 -03:00
fiatjaf
1022fb76fa successfully mixing in a normal font + the emoji font for some runes only through a myriad of weird hacks. 2023-12-26 22:08:24 -03:00
fiatjaf
9be417fc7c bring in HarfbuzzShaper into code as a function so we can modify it. 2023-12-26 19:38:27 -03:00
fiatjaf
124dc390d4 basically revert the previous commit. 2023-12-26 11:05:40 -03:00
fiatjaf
86f6a09ea3 using a custom RunIterator that takes emojis into account and shapes them with a different font.
it doesn't actually work since the different outputs returned are treated by LineWrapper as necessarily belonging to different lines, so we'll have to do something different.
2023-12-26 11:02:45 -03:00
fiatjaf
28d7a73adf shorten URLs when rendering text image so they don't use all the space. 2023-12-25 23:27:23 -03:00
fiatjaf
a7b56f046b rendering everything with nice script and language detection and font-picking. 2023-12-25 23:27:23 -03:00
fiatjaf
5df944705e use go-text/typesetting library to render text better: rendering farsi. 2023-12-25 23:27:09 -03:00
Daniele Tonon
d790729fb6 Optimize masking for long author names 2023-12-24 22:38:22 +01:00
Daniele Tonon
bb3cfc1157 Add a cut gradient to author name if it's too long 2023-12-24 19:06:08 +01:00
Daniele Tonon
ee076ef22b Fix text-image date position for Twitter 2023-12-24 18:58:31 +01:00
Daniele Tonon
572e9f2974 Fix text-image bar rendering for Twitter 2023-12-24 17:27:43 +01:00