Steve Lhomme
ff0c91ff96
text_render/svg: remove unneeded forward declarations
11 months ago
Steve Lhomme
e2fa4b9ebc
text_render/svg: set decoded pictures as SDR explictly
11 months ago
Steve Lhomme
87b3968aea
vlc_subpicture: remove always NULL format in subpicture_region_ForPicture()
This makes the code less confusing.
11 months ago
Steve Lhomme
42163de65c
vlc_subpicture: add a flag telling if a region is placed in the window
...rather than in the video.
It's off by default for now.
This effectively disables "subtitles in black bars" as no SPU source is
setting this flag yet.
1 year ago
Steve Lhomme
182aa13259
freetype: keep the absolute flag on the output
Since we keep the alignment as well.
1 year ago
Steve Lhomme
e25ec4e25b
freetype: avoid very large fonts in portrait mode
Either when the video is in portrait mode or when the subtitles
are shown in the black bars and the video area is in portrait mode,
the text can become very large just because we apply a percentage base on
the output height.
We switch mode when the height becomes bigger than the width
so there's a continuity in the ratio when growing/shrinking the
video in one direction or the other.
1 year ago
Alexandre Janniaux
ce4be86d93
svg: fix include path to cairo.h
pkg-config --cflags cairo returns the path to the folder containing
cairo.h.
1 year ago
Steve Lhomme
b606a740e8
sapi: remove unneeded forward declaration
Fixes this odd warning:
```
vlc/modules/text_renderer/sapi.cpp:64:12: warning: unused function 'RenderTextMTA' [-Wunused-function]
64 | static int RenderTextMTA(filter_t *, subpicture_region_t *);
| ^~~~~~~~~~~~~
```
1 year ago
Alexandre Janniaux
cdb321ec21
text_renderer: meson.build: add missing cairo dep to svg
1 year ago
Marvin Scholz
e10ccd76fa
meson: text_renderer: add harfbuzz support
2 years ago
Marvin Scholz
fae9800b57
meson: text_renderer: add fribidi support
2 years ago
Marvin Scholz
e4c9b6c2b2
modules: freetype: mark argument as unsued
2 years ago
Marvin Scholz
b7f90fb171
meson: text_renderer: add fontconfig support
2 years ago
Marvin Scholz
30fc276b2d
meson: text_renderer: use new 'enabled' attribute
2 years ago
Fatih Uzunoglu
ffb6cc6933
use `COINIT_DISABLE_OLE1DDE` with `CoInitializeEx()`
It appears that OLE 1.0 is not utilized, so it should
be beneficial to set this flag.
From "Initializing the COM Library":
> ... it is a good idea to set the COINIT_DISABLE_OLE1DDE
> flag in the dwCoInit parameter. Setting this flag avoids
> some overhead associated with Object Linking and Embedding
> (OLE) 1.0, an obsolete technology.
2 years ago
Marvin Scholz
e91726d621
freetype: darwin: make getFontIndexInFontFile static
Fixes compiler warning about missing prototype and also this function
is only ever used in this file.
2 years ago
Jiepeng Huang
6497bee48a
text_renderer: change -1 to kCFNotFound
2 years ago
Jiepeng Huang
96ae876dc8
text_renderer: improve code style in darwin.c
2 years ago
Jiepeng Huang
c52066f204
freetype: darwin: ignore case whe comparing
The `psz_lcname` is lowercase, so we need to use `strcasecmp`
instead.
2 years ago
Jiepeng Huang
2e3c0fb6bc
freetype: darwin: fix font index issue
In macOS/iOS/tvOS, font collection file contains multiple fonts.
The 0 index should not be used by default, but the corresponding
index should be used. This will fix some font rendering bugs and
fallback font bugs.
2 years ago
Alexandre Janniaux
485a45f328
freetype: remove unused i_chroma parameter
Since 83e1862210 , the parameter i_chroma
is not used anymore.
2 years ago
François Cartegnie
a6b5ec1b99
text_renderer: freetype: fix region inner rendered area global offset
refs #28525
regression by e2e4df6826 .
2 years ago
Fatih Uzunoglu
385339eaaa
text_renderer: add dwrite to freetype_deps in meson
2 years ago
Steve Lhomme
6f64a9777c
freetype: set the colorimetry on the region picture
Rather than the attached format used for cropping.
2 years ago
Steve Lhomme
e5cebd7857
freetype: use the YUVP region picture for palette/buffer handling
Rather than the attached format used for cropping.
2 years ago
Steve Lhomme
eeb64b3600
svg: use the cropping data from the source picture
If the original picture has some aspect ratio and/or cropping, it needs to be respected when drawing it.
2 years ago
Steve Lhomme
fe1c5da7bf
freetype/win32: use WCHAR for variables using WCHAR calls
2 years ago
Steve Lhomme
8c407b409c
freetype/win32: use WCHAR API's explicitly
Since we use pathes in WCHAR, the rest of the API calls can only be the W
variants.
2 years ago
Steve Lhomme
ab501d6a93
freetype/win32: fix string constant when using WCHAR/wchar_t API's explicitely
2 years ago
Steve Lhomme
c9db3816db
freetype/win32: fix EnumFontCallback prototype
So we don't need a cast on a function pointer.
2 years ago
Steve Lhomme
f4d040e050
freetype/win32: fix bogus string cast
lfFaceName is a WCHAR table.
2 years ago
Steve Lhomme
97865904ac
freetype: fix region background dimension
The text source video format is not reliable since fe415420f3 .
We can use the picture dimension.
2 years ago
Steve Lhomme
7fe0b8e73e
freetype/win32: keep iterating until we get a match
See documentation [1].
[1] https://learn.microsoft.com/en-us/windows/win32/api/wingdi/nc-wingdi-enhmfenumproc
2 years ago
Steve Lhomme
ae4942ee29
text_renderer/svg: don't write text if XML was not converted properly
2 years ago
Steve Lhomme
54897d1ebf
text_renderer: warn when the rendering cannot be done
Due to requested chromas not being supported.
2 years ago
Steve Lhomme
682bb69fa0
freetype: reduce indentation
2 years ago
Steve Lhomme
83e1862210
freetype: create the output region outside of rendering functions
The rendering cannot fail. The error handling only needs to be done in one
place.
2 years ago
Steve Lhomme
451830aa94
freetype: remove extra 4 pixels for YUVP rendering
It should use the same size as the non-palletized formats, i.e. the
size used in RenderAXYZ().
It was added in 2479a41d19 .
2 years ago
Steve Lhomme
b81bc6958c
freetype2: fix palette filling in YUVP
Since fe415420f3 the palette set in the local
format is not set on the output region format.
The palette of the region is created in subpicture_region_New() and the
same pointer is used between the region format and the picture format.
2 years ago
Steve Lhomme
f58c19a8b4
subpicture: don't call text renderer with no text
The text renderers and text to speech module don't produce anything if
there's no text. No need for defensive programming in each module.
2 years ago
Steve Lhomme
8bac00db8c
text_renderer: remove rendundant check on input
It's already checked by the caller via SpuRenderText().
2 years ago
Steve Lhomme
7261e7a01a
freetype: do not use the input region palette
The input region is a text region, it should not have a palette. We would
overwrite the input palette with out own values!
subpicture_region_New() takes care of creating a palette if the format
doesn't have one.
2 years ago
Steve Lhomme
fe415420f3
vlc_filter: return a non-text subpicture region when rendering text regions
We no longer need to ugly hack that marks the output region as marked
and we don't mix the input and output regions.
3 years ago
Steve Lhomme
569c1d039a
freetype: allocate the YUVP palette early
2 years ago
Steve Lhomme
75d83e3501
vlc_filter: pass the input text region as const
2 years ago
Steve Lhomme
77b7e53190
text_renderer/svg: use the input region to compute the width/height
2 years ago
Steve Lhomme
ea6bf194a0
text_renderer/svg: remove redundant check
The same check is done at the beginning of the function.
2 years ago
Steve Lhomme
e8247d8fc8
freetype: separate input and output region internally
2 years ago
Steve Lhomme
e2e4df6826
freetype: position the output region once it's settled
The region position is not used when rendering it.
2 years ago
Steve Lhomme
19aba7aefa
freetype: constify line_desc_t parameters
2 years ago