Commit Graph

87 Commits

Author SHA1 Message Date
Yuri Kobets
d0986f2b24 Conic gradient support for the container_cairo 2025-05-27 03:19:07 +03:00
Yuri Kobets
2d34cb9f09 fixed: elements with 'position:fixed' have issue with draw
* document_container::get_client_rect was renamed to get_viewport.
* updated draw_buffer class to handle fixed elements on scroll
2025-04-11 02:53:37 +03:00
Yuri Kobets
1274232171 Includes refactoring using clangd 2025-04-06 23:10:39 +03:00
Yuri Kobets
c33894eab4 fix: std::array is not defined in container_cairo_pango.cpp 2025-03-30 03:34:51 +03:00
Yuri Kobets
c214c27d2c Destroy cairo_surface_t in container_cairo::draw_list_marker 2025-03-28 04:58:18 +03:00
Yuri Kobets
23751c1421 Support for text-decoration CSS properties
Supported properties:
* text-decoration (as shorthand for other text-decoration properties)
* text-decoration-color
* text-decoration-line
* text-decoration-style
* text-decoration-thickness

Changes in the container::create_font:
```litehtml::uint_ptr create_font(const font_description& descr, const document* doc, litehtml::font_metrics* fm);```

All font parameters are moved to the ```font_description``` structure.
2025-03-12 23:09:56 +03:00
Yuri Kobets
65128c39b3
Updated inline layout rendering (#389)
* Added subscripts/superscripts baseline shift to the font_metrics
* Improved rendering of inline elements with top and bottom vertical align
* Improved rendering of the line-height property
2025-03-07 17:30:32 +03:00
Yuri Kobets
33f12ff153 render2png: Apply render settings from <file>.cfg file
The following settings can be applied:
width - force width to draw
height - force height to draw
bestfit - (true or false) Use false to disable "best fit" feature
2024-10-05 15:22:42 +03:00
Yuri Kobets
071ce868ca pango container: fixed font height calculation and draw 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
3dc2792560 render2png: fixed crash if content width/height is zero 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
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
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
Yuri Kobets
b5ab35fa12 container_cairo_pango: select font from list of available fonts 2024-04-01 15:59:08 +03:00
Yuri Kobets
6249f6dd89 fixed: container_cairo_pango doesn't use specified fonts 2024-03-31 13:38:50 +03:00
Yuri Kobets
2f207bc349 cairo_container: apply repeat-x/repeat-y to the gradients 2024-03-29 03:04:40 +03:00
Yuri Kobets
7d1ca0328f Added support for conic gradient 2024-03-29 03:04:40 +03:00
Yuri Kobets
18cc822603 Fixed origin top/height for radial gradient 2024-03-29 03:04:40 +03:00
Yuri Kobets
c09b943216 draw radial gradient 2024-03-29 03:04:40 +03:00
Yuri Kobets
e455a0b50f Background draw redesigned. Linear gradient support. 2024-03-29 03:04:40 +03:00
Yuri Kobets
58a1db79b9 Background parsing fixex. Added support for linear gradient 2024-03-29 03:04:40 +03:00
faywong
270b7389d1 Fix build error caused by non-const copy ctor of cairo_surface_wrapper
Detailed error context: 
containers/cairo/cairo_images_cache.h:64:11: note: in instantiation of template class 'std::__value_type<std::string, cairo_surface_wrapper>' requested here
                if(iter != m_images.end())

MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/__utility/pair.h:54:5: error: the parameter for this explicitly-defaulted copy constructor is const, but a member or base requires it to be non-const
    pair(pair const&) = default;
2024-03-27 17:17:50 +03:00
Yuri Kobets
6a0cb81436 reserve methon of cairo_images_cache return true if reserved something 2024-02-25 17:59:23 +03:00
Yuri Kobets
a71d6f5cd1 some changes in windws container 2024-02-25 17:41:00 +03:00
Yuri Kobets
6044a59826 added simple images cache for cairo based containers 2024-02-24 16:57:22 +03:00
Yuri Kobets
fe84eff36b Change location of containers
Now:
* cairo - contains cairo container
* windows - contains containers for windows
2024-02-24 00:20:45 +03:00
Yuri Kobets
42632777fb Fix compile bugs on Windows 2023-10-18 03:56:58 +03:00
Yuri Kobets
3b896beede changed signature of document_container::set_clip
Removed arguments valid_x and valid_y because they are always true
2023-05-12 18:13:13 +03:00
stasoid
28a2831518 support multiple background images 2023-02-25 10:33:42 +06:00
stasoid
de4893f0b6 document::createFromString optimization:
Move css property parsing from css_properties::parse (which is called from html_tag::parse_styles for every tree node)
to style::add_property (which is called during stylesheet parsing).
document::createFromString: 1287 ms -> 1048 ms on Obama wiki
2022-11-27 02:48:04 +06:00
stasoid
a6177d1d5e remove wchar support
closes issue #217
2022-10-21 17:51:29 +06:00
stasoid
8e21841ad9 Update win32_container and gdiplus_container 2022-10-18 09:13:45 +06:00
Tig Kindel
8aa119c59b removed .orig files 2022-08-10 15:18:56 -06:00
Tig Kindel
1c4c9b49a8 merge 2022-08-10 15:17:19 -06:00
stasoid
ea3c8f7f33 cairo_container: fix handling of invalid list-style-image
page: https://en.wikipedia.org/wiki/UTF-8#Invalid_sequences_and_error_handling
culprit: ul{list-style-image:url(/w/skins/Vector/resources/common/images/bullet-icon.svg?d4515)}
(invalid because svg is not supported)
2022-03-26 20:12:55 +06:00
Yuri Kobets
91774bbc39 Fixed bug in Cairo CSS font handling (Windows) 2021-11-07 19:25:07 +03:00
Yuri Kobets
7d234d9a7e Use pango library as text renderer for container_linux 2021-11-07 03:53:00 +03:00
Yuri Kobets
eda357bded Fixed build errors on Windows 2021-11-05 03:33:14 +03:00
Charlie Kindel
97f92ca720 Support font names surrounded by single quotes 2020-02-16 17:26:19 +01:00
Charlie Kindel
433da5df8c Fix for building litehtmlbrowser in VS2016 2020-02-16 16:44:23 +01:00
Yuri Kobets
7abfe7d83e cairo_container: compilation error fix for UTF8 configuration 2018-09-10 23:12:21 +03:00
NikitaFeodonit
3104c078dc Convert line delimiters to Unix style. 2018-05-25 17:05:49 +03:00
Yuri Kobets
013b065e94 Added support for custom color names. 2016-08-01 21:40:56 +03:00
Yuri Kobets
fcb2ac8fcc Some changes in containers to pass const shared_ptr<>& 2015-07-10 00:50:50 +03:00
Yuri Kobets
14208ecda0 using override keyword in cairo_container
added default implementation for document_container::link function
2015-07-06 23:39:44 +03:00
Yuri Kobets
192987ecc9 Fixed all bugs. Rendering working well. 2015-06-30 01:23:58 +03:00