Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
53 views

SwiftUI How can I get the correct font size for CATextLayer

I am using SWiftUI and have a video editing application . A person selects a video and we display it along with the date the video was taken . The initial overlay is size 14 and if the person saves ...
user1591668's user avatar
  • 2,851
1 vote
0 answers
41 views

CATextLayer is blurry on non-retina display

On a non-retina display (Mac), my CATextLayer instances produce text that is blurrier than what I get with NSAttributedString's -drawAtPoint: See for yourself: At the top, a CATextLayer instance (...
jeanlain's user avatar
  • 418
0 votes
1 answer
106 views

How to measure character bounds within a text shown by CATextLayer?

I am fresh to IOS development. I am looking for a way to retrieve detailed text layout information (such as ascent, descent, advance width etc). In android, I am able to do this through Paint....
Polar Bear's user avatar
0 votes
2 answers
349 views

Using a CATextLayer to Mask Out From Another CALayer

For whatever reason, I can't get this to work with a CATextLayer. I suspect it's totally obvious, and I can't see the forest for the trees, but what I need to do, is use a CATextLayer to mask a "...
Chris Marshall's user avatar
1 vote
1 answer
248 views

Different font output for same NSAttributedString with CATextLayer and NSTextView

In macOS using the same NSMutableAttributedString for a CATextLayer and a NSTextView seems to give different rendering results. The NSTextView has a slightly larger font than a CATextLayer. This ...
Chris Walken's user avatar
0 votes
1 answer
114 views

Animate `CATextLayer` font-size from bottom left

is it possible to animate the font-size of a CATextLayer, starting from bottom left? I am able to animate the CATextLayer with the following code, but it is always starting from top-left: let ...
user3532505's user avatar
0 votes
1 answer
58 views

how to add test on a vedio or CAtextlayer. i want to show text on the recorded videos. and when i do it audo is fine video go blank.Thanks in Advance

I am recording 3 videos and merging them into one. I need text on all the videos. am doing it but no success. the video goes black and the audio comes fine. When I do it without CALayer everything is ...
MUHAMMAD AHMAD's user avatar
2 votes
0 answers
195 views

CATextLayer's text cut off

I want to show a CATextLayer inside of a UIView and change the text and the font of the textlayer. But texts in textlayer cut off the device in the right side. Most Weird thing is, if I send app in ...
Shahriar Nasim Nafi's user avatar
0 votes
1 answer
990 views

CATextLayer position and Transformation issue

I am trying to build a control like attached circle image with multiple segment having equal space for each part. Number of segments can change depend upon provided array. I have developed this so far ...
Surjeet Singh's user avatar
1 vote
0 answers
102 views

Insert CATextLayer inside UIBezierPath and rotate

In the following example I'm trying to insert a CATextLayer inside a UIBezierPath and rotate it -45 degrees. class DiagonalView: UIView { override func draw(_ rect: CGRect) { let path = ...
Konstantinos Natsios's user avatar
2 votes
2 answers
490 views

CATextLayer on video pixelated text

I am creating video from images and adding overlay to them. Problem is when I try to add CATextLayer to video. Text is pixelated, take a look at the image This is the code used to generate ...
Baki's user avatar
  • 590
0 votes
0 answers
30 views

Swift do not repaint CATextLayer

I'm use extension of button for implements my own method to the UIButton, and the create a CATextLayer for add 1 more text in button, but where im call this method with different arguments (Text) ...
Evnika GK's user avatar
1 vote
0 answers
118 views

Issue while assigning UITextView frame to CATextLayer

I'm retrieving subviews(UITextView) from the UIImageView and with the content of the UITextView I'm creating CATextLayer to add in the video file because I need to show each frame for a particular ...
Hemant Singh Rathore's user avatar
0 votes
1 answer
1k views

CATextLayer cannot align to center horizontally with UILabel text in swift

When i use CATextLayer in swift 5, i align it to center by using Horizontal alignment modes follow here but it cannot align to center. Here is some of my code myLabel.textAlignment = .center ...
Nguyen Thanh Tai's user avatar
0 votes
2 answers
898 views

How to reduce the quality of the text inside UITextView with Swift

I'm trying to reduce the quality of a message before its being sent, for example if the connect is poor I want to blur out the text in the UITextView and if connection improves or internet comes back, ...
sk123's user avatar
  • 590
2 votes
1 answer
694 views

Is it possible to add a UILabel or CATextLayer to a CGPath in Swift, similar to Photoshop's type to path feature?

I would like to add text, whether it be a UILabel or CATextLayer to a CGPath. I realize that the math behind this feature is fairly complicated but wondering if Apple provides this feature out of the ...
John Martz's user avatar
1 vote
0 answers
374 views

How can I vertically center multiple lines of text in a CATextLayer?

I'm trying to vertically align text that has multiple lines inside a CATextLayer. I'm working off the code from this answer (which is for one line), and adding in a calculation for the number of lines,...
brontea's user avatar
  • 605
1 vote
1 answer
549 views

How can I rotate a CATextLayer properly in Swift?

I'm currently facing an issue that when rotating a CATextLayer the frame size would be transformed unexpectedly at the same time. I expect the text can be rotated at some angle without changing its ...
Joey Zhang's user avatar
1 vote
0 answers
274 views

How to show different text over video based on time range using CATextLayer? [duplicate]

I'm working on a video app, that requires displaying text over video for a certain range of time, I need to display different text for different time ranges. I've already created a text layer and ...
Nazmul Islam's user avatar
-1 votes
1 answer
225 views

What is the value for spacing between lines in a wrapped CATextLayer?

I am trying to create a CATextLayer with a frame that is the exact size of 3 lines of text + the spacing in between this text. I know that my font size is 12. The height of the frame should therefore ...
Sam's user avatar
  • 2,158
0 votes
2 answers
275 views

CATextLayer not rendering properly on SCNNode

I have a hierarchy of CALayers that I am setting as the diffuse property of my SCNNode's material. I taking snapshots of the current state of the scene (that only has the one node) to save as a PNG to ...
Jsdodgers's user avatar
  • 5,281
0 votes
1 answer
1k views

add textview as a sublayer of an image ios swift

let ss = CATextLayer() ss.frame = rect ss.backgroundColor = UIColor.blue.cgColor ss.foregroundColor = UIColor.cyan.cgColor ss.string = mytextView.text myImage.layer.addSublayer(ss) I am ...
Faheem Rahman's user avatar
4 votes
0 answers
600 views

AVMutableVideoComposition With CATextLayer Ending Up With No Text String

I'm trying to insert a text layer (CATextLayer) to a movie. To begin with, let me insert a text layer (CATextLayer) to a wired NSView object like let myLayer = CALayer() let textLayer = CATextLayer()...
El Tomato's user avatar
  • 6,687
0 votes
1 answer
854 views

How to get "string" attribute value of CATextLayer in swift 4?

I am trying to access the text value in the CATextlayer, I can access other values but this string attribute cannot be accessed and it isn't even displayed on intellisence either. Is there some other ...
Muhammad Taha's user avatar
0 votes
2 answers
2k views

Add text to Video for specific time in iOS

I am creating a video based application where I have to select any video from local gallery and have to add a text using CATextLayer over the Video. For this I am using below code: - (void) ...
Anand Gautam's user avatar
  • 2,569
2 votes
1 answer
1k views

NSMutableAttributedString paragraphStyle not applying

I've added an NSMutableAttributedString to a CATextLayer. All of the attributes are applying except for the paragraphStyle. Any thoughts as to why? Thanks for the help. func createTextLayer() { ...
MT1asli8ghwoi's user avatar
2 votes
2 answers
482 views

How to rotate CATextLayer and preserve it's size?

I have a custom view, which I use for markup (draw lines and other figures on it). The view controller recognizes touches and gestures and passes info to the view so it can draw itself properly. Each ...
denysowova's user avatar
1 vote
0 answers
222 views

Swift 4 / Xcode - Display string value(s) from an Array/Struct to CATextLayer()

I am struggling to get this to work. I have a struct in place to help to pass data through each .swiftfile. (Only have one view controller). This is my Message class where both the text layer and ...
iSwift's user avatar
  • 15
1 vote
1 answer
57 views

Replicating CATextLayer with different string

I am creating gridlines using CAReplicatorLayer. To each gridline, I also want to add a CATextLayer that shows the corresponding numerical value. I do not want to do this manually, however with ...
Nikolay Spassov's user avatar
0 votes
0 answers
316 views

How to make CATextLayer to follow the same BeizerPath defined for the shape

I am trying to make a CAShapeLayer with a sublayer of CATextLayer to follow a UIBezierPath. I am able to draw the CAShapeLayer using UIBezierPath but CATextLayer doesn't follow the same path. Here ...
Rohit Kumar's user avatar
1 vote
1 answer
2k views

CATextLayer number of lines?

My CATextlayer support only 1 line otherwise the text is cut. trying to set text content like UILabel Behaviour... is it possible? set "number of lines" adjust text size by static CATextLayer frame ...
Ofir Malachi's user avatar
  • 1,288
6 votes
3 answers
1k views

How to correct UIView and UILabel text scaling with pixelation?

When I add a UILabel with text to a UIView and then scale the UIView, the contents is displayed with pixelation. The greater the scale factor, the greater the pixelation. I understand using a ...
user4806509's user avatar
  • 3,005
1 vote
1 answer
299 views

Mac OSX custom screen saver

How exactly can text be added to a custom screen saver, using a CATextLayer? I'm trying to display a string of text drawn on a CATextLayer as part of a screen saver. - (void) startAnimation { [...
raass_claat's user avatar
1 vote
0 answers
447 views

AVVideoComposition doesn't add Text to video - iOS 10.3

I recently posted a question regarding exporting a video with a textOverlay (using AVVideoComposition). I am trying to apply a CATextLayer overlay to a video in swift using the following method : ...
6994's user avatar
  • 107
1 vote
1 answer
61 views

CATextLayer in SCNBox shows in portrait mode

I am trying to write text onto a SCNBox node. I see the text in the box but the text orientation is portrait. How do I make this landscape? screenshot CALayer *layer = [CALayer new]; [layer ...
Prashant Bharat Bhide's user avatar
2 votes
0 answers
264 views

Why is the wordWrapping result is different CATextlayer and UILabel

I'm trying to set the text with CATextLayer and UILabel. Same Font, Size and Bounds but WordWrapping result is different. Here is my code. let textHeaderAttributes = [ ...
Shawn Baek's user avatar
  • 1,957
1 vote
0 answers
133 views

How can I "animate" modifications in the string property of a CATextLayer?

When I instanciate a CATextLayer, and change the string property from "hello world" to "hello world!!" then I do see the change in the resulting ui, but it is not subtle. It jumps out of my face. So ...
yves Baumes's user avatar
  • 9,016
2 votes
0 answers
148 views

MacOS CALayer Character Spacing

I have a problem which I hope you can help me solving. I'm creating a program using Xamarin.Mac (C# for Mac) and I need to draw a DNA sequence (ATGC and so on). However, I need to know the exact ...
Frederik Theisen's user avatar
0 votes
0 answers
119 views

CATextLayer's `foregroundColor` not working with CAKeyframeAnimation and timeOffset?

I need to animate the color of CATextLayer, and the animation itself works: CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"foregroundColor"]; animation.duration = 1.0f; ...
Heuristic's user avatar
  • 5,301
1 vote
2 answers
442 views

Adding multiple texts to AVMutableVideoComposition

I am composing a video using AVMutableComposition. I need to add text overlay at different time intervals. i,e. display string "abc" from 0sec to 2sec hide afterwards display string "xyz" from 1sec ...
Mohamed Irshad's user avatar
0 votes
2 answers
844 views

Creating raining code Matrix effect

Created a sub class of a CATextLayer within which I attached a fadeIn animation, which I than add to a CATextLayer to which I have attached a dropThru animation. The goal to try and create matrix ...
user3069232's user avatar
  • 8,941
4 votes
1 answer
3k views

Figuring out the size of the textBox in a CATextLayer

I wrote this code, works well; but I need to figure out the size of the text in the CATextLayer to finish it? The idea I use from a tap gesture to get the x/y, enter the text and have it figure out ...
user3069232's user avatar
  • 8,941
0 votes
0 answers
530 views

CATextLayer : Text is not showed

When I tried to add image as CATextLayer content, text is not shown. Only image is shown. This is my code which I have placed in viewDidLoad() method, UIImage *uiimage = [UIImage imageNamed:@"...
rishu1992's user avatar
  • 1,424
0 votes
1 answer
190 views

Scenekit: Objects become invisible after several objects are added (Objective-C)

I am building a game with SceneKit. It is based on SCNBoxes which get added and removed. At the end there are like 30 boxes added to the root node. // Prepare Surface Layer for Blocks self....
Alexander Langer's user avatar
5 votes
0 answers
232 views

CATextLayer ignores NSShadow?

I have a custom UIView that I've created that has several custom UIControl instances which are non-rectangular buttons (instead of using UIButton instances). I am doing this because I need to be able ...
mbm29414's user avatar
  • 11.6k
1 vote
1 answer
494 views

Render different resolutions in AVMutableComposition

When using AVMutableComposition to add a CATextLayer on top of a video, is there a way to render the text layer in a higher resolution than that of the video? The video is currently 1024x576, and I ...
Daniel Larsson's user avatar
6 votes
2 answers
13k views

How to change the text color in a CATextLayer in Swift

I want to change the text color of a CATextLayer. This does not work myTextLayer.textColor since there is no such property. I also got no response by setting the foreground color textLayer....
Suragch's user avatar
  • 507k
1 vote
0 answers
199 views

Frame of CATextLayer changes after rotation

I set the frame of CATextLayer everything is working fine, but when I rotate the text layer 90 degree it loses the position after video crop. This is when i set the position of my textview: This ...
Mitesh Varu's user avatar
1 vote
1 answer
430 views

CATextLayer is ignoring NSMutableParagraphStyle

I want to use NSMutableAttributedString to draw the text on the CATextLayer with the text. I try set attributes to the like font and fontcolor of the NSMutableAttributedString through the [attrString ...
Q.Chuang's user avatar
5 votes
1 answer
5k views

What to do with CATextLayer to have the same font displayed as the system font in UILabel?

When I use UILabel, I set the system font as: label.font = UIFont.systemFontOfSize(18, weight: UIFontWeightMedium) Now I try to use CATextLayer and I searched online and found out that the system ...
Joe Huang's user avatar
  • 6,480