Commit Graph

951 Commits

Author SHA1 Message Date
Yuri Kobets
071ce868ca pango container: fixed font height calculation and draw 2024-10-05 15:22:42 +03:00
Yuri Kobets
b648fecb49 Use border box to check intersection with the clip in the draw_background 2024-10-05 15:22:42 +03:00
Yuri Kobets
1e9d0be84b render2png: added url decode 2024-10-05 15:22:42 +03:00
Yuri Kobets
1514b1678d Added support for 'ex' and 'ch' units. Improved calculating x-height metric. 2024-10-05 15:22:42 +03:00
Yuri Kobets
d6e87e381e fix: content width is zero for html/body tag with overflow not equal visible 2024-10-05 15:22:42 +03:00
Yuri Kobets
e490d8c379 fix the height of blocks with "display:list-item" 2024-10-05 15:22:42 +03:00
Yuri Kobets
3dc2792560 render2png: fixed crash if content width/height is zero 2024-10-05 15:22:42 +03:00
Yuri Kobets
5cb006e5ad fixed: crash if html tag has display:none property 2024-10-05 15:22:42 +03:00
Yuri Kobets
2393adce1d fixed bug with content size calculation 2024-10-05 15:22:42 +03:00
Yuri Kobets
28a999de56 Support for "font: <system-family-name>" 2024-10-05 15:22:42 +03:00
Yuri Kobets
b889fa39e2 render2png: pass clip rect to the doc->draw 2024-10-05 15:22:42 +03:00
Yuri Kobets
f1f5ec1af2 fixed bug with font css property parsing 2024-10-05 15:22:42 +03:00
Yuri Kobets
01cb5911f1 Move tests to the another repository
Tests are moved to this repository:
https://github.com/litehtml/litehtml-tests
2024-09-11 01:15:23 +03:00
Yuri Kobets
78f08f3080 Tests update
1. Using container_cairo_pango for running tests.
2. Added Dockerfile to create docker container for building litehtml
   tests
3. Added script run_render_tests.sh to build litehtml tests in the
   docker container
4. Added render2png target (cmake -DLITEHTML_BUILD_RENDER2PNG). This
   utility allow to render html file into a png file.
5. Tests building are off by default.
   Use "cmake -DLITEHTML_BUILD_TESTING=ON" command to buid tests
6. Added container_cairo_pango::get_font_options. Overwrite this method
   to control fonts rendering.
2024-09-10 02:20:02 +03:00
Yuri Kobets
64833d8f77 Revert "{doc} Update README"
This reverts commit 8b537d8b1de70acdbad83c312fc22fd5730c9e9d.
2024-08-19 16:41:50 +03:00
Andy Maloney
4b93e2f45e {doc} Update README 2024-08-19 16:41:50 +03:00
Andy Maloney
1bd4c59c0d Remove extraneous namespace in test container 2024-08-19 16:41:50 +03:00
Andy Maloney
577367ecc9 Use one callback with enum to avoid extra API (#2) 2024-08-19 16:41:50 +03:00
Andy Maloney
a8092d6c2f Add basic clang-format
At least try to keep tabs...
2024-08-19 16:41:50 +03:00
Andy Maloney
1a54872a46 Add callbacks for mouse entering/leaving elements (#1)
Useful for showing URLs from anchors or for debugging.
2024-08-19 16:41:50 +03:00
Yuri Kobets
94104fb60d exclude support folders from render test 2024-08-19 16:34:02 +03:00
Yuri Kobets
32fb235cdd cairo container: improve image scaling 2024-08-19 01:58:21 +03:00
Yuri Kobets
899b2986ce Cairo container: draw image list marker 2024-08-16 01:10:31 +03:00
Yuri Kobets
9e0df0904c Cairo container: Fixed crash on zero length border with style dashed and dotted 2024-08-06 02:37:28 +03:00
stasoid
e1feaf2010 ignore negative border-spacing 2024-06-01 23:40:54 +03:00
stasoid
d47472a221 support picas 2024-06-01 23:40:54 +03:00
stasoid
1381c60f7a fix case q in https://test.csswg.org/suites/css21_dev/20110323/html4/background-position-203.htm 2024-06-01 23:40:54 +03:00
stasoid
cf59a56269 fix margin-bottom-043.htm
This only partially fixes the problem exhibited by the test. We still lose precision when converting points to int. document_container::pt_to_px() should take float.
2024-06-01 23:40:54 +03:00
stasoid
a338c907e7 remove code duplication in document::cvt_units 2024-06-01 23:40:54 +03:00
stasoid
d28a805bcd fix border: solid black 2024-06-01 23:40:54 +03:00
stasoid
3598c7a208 render_test: refactoring 2024-06-01 23:40:54 +03:00
stasoid
ddc987b0a6 handle inherit keyword for more shorthands 2024-05-25 23:00:54 +03:00
stasoid
1393ff5f21 fix list-style-020.htm
marker positions are still a bit wrong though
2024-05-25 23:00:54 +03:00
stasoid
313b647923 render_test: colorize output in standalone mode
https://stackoverflow.com/questions/62936815/how-to-color-output-in-c-for-cross-platform-app
Windows hack:
https://bugs.python.org/issue30075#msg291732
Windows proper usage:
https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#example
https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#text-formatting
2024-05-25 23:00:54 +03:00
stasoid
c264530997 render_test: use <filesystem> instead of <dirent.h>, <sys/stat.h> 2024-05-25 23:00:54 +03:00
stasoid
a038b36c6d render_test: add -d option to compare png files 2024-05-20 00:40:31 +03:00
stasoid
b2c775434e render_test: print summary in standalone mode 2024-05-20 00:40:31 +03:00
stasoid
27696b8d8e test_container: correctly draw multicolor borders 2024-05-20 00:40:31 +03:00
stasoid
863d6fe713 remove outdated comment 2024-05-20 00:40:31 +03:00
stasoid
41d9de3a25 test_container: update readme.txt 2024-05-20 00:40:31 +03:00
stasoid
def2684c1b fix VS warning 2024-05-20 00:40:31 +03:00
stasoid
28bbe74ec9 test_container: support TTF fonts 2024-05-20 00:40:31 +03:00
stasoid
d5426075fa canvas_ity: add get_font_metrics() 2024-05-20 00:40:31 +03:00
stasoid
138f712eb8 canvas_ity: fix font baseline position computation 2024-05-20 00:40:31 +03:00
stasoid
218eb74ae8 make m and w more bold in terminus-16px-bold.yaff
They didn't look bold enough. There is no space, so I made m/w wider. This makes terminus-16px-bold.yaff a variable-width font, which may be confusing because normal weight variant is monospace. I also used this variable-width opportunity to improve NMW glyphs.

Rendering of css-box-justify-content.htm changed because width of nbsp is computed correctly now.
2024-05-20 00:40:31 +03:00
stasoid
6c4e6ef10a test_container: add terminus-16px-bold.yaff 2024-05-20 00:40:31 +03:00
stasoid
8d16a94e32 test_container: support list-style-image 2024-05-16 22:54:49 +03:00
stasoid
30e4fd105c test_container: support list-style-type disc and circle 2024-05-16 22:54:49 +03:00
stasoid
7b7d292b58 fix gcc warning 2024-05-16 22:54:49 +03:00
stasoid
802b039e62 cleanup 2024-05-16 22:54:49 +03:00